package export
import "github.com/knqyf263/go-plugin/examples/host-function-library/library/json-parser/export"
Index ¶
- Variables
- func Instantiate(ctx context.Context, r wazero.Runtime, hostFunctions ParserLibrary) error
- type ParseJsonRequest
- func (x *ParseJsonRequest) GetContent() []byte
- func (m *ParseJsonRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ParseJsonRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *ParseJsonRequest) MarshalVT() (dAtA []byte, err error)
- func (x *ParseJsonRequest) ProtoReflect() protoreflect.Message
- func (m *ParseJsonRequest) SizeVT() (n int)
- func (m *ParseJsonRequest) UnmarshalVT(dAtA []byte) error
- type ParseJsonResponse
- func (x *ParseJsonResponse) GetResponse() *Person
- func (m *ParseJsonResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ParseJsonResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *ParseJsonResponse) MarshalVT() (dAtA []byte, err error)
- func (x *ParseJsonResponse) ProtoReflect() protoreflect.Message
- func (m *ParseJsonResponse) SizeVT() (n int)
- func (m *ParseJsonResponse) UnmarshalVT(dAtA []byte) error
- type ParserLibrary
- type Person
- func (x *Person) GetAge() int64
- func (x *Person) GetName() string
- func (m *Person) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Person) MarshalToVT(dAtA []byte) (int, error)
- func (m *Person) MarshalVT() (dAtA []byte, err error)
- func (x *Person) ProtoReflect() protoreflect.Message
- func (m *Person) SizeVT() (n int)
- func (m *Person) UnmarshalVT(dAtA []byte) error
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
Functions ¶
func Instantiate ¶
Instantiate a Go-defined module named "json-parser" that exports host functions.
Types ¶
type ParseJsonRequest ¶
type ParseJsonRequest struct { Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*ParseJsonRequest) GetContent ¶
func (x *ParseJsonRequest) GetContent() []byte
func (*ParseJsonRequest) MarshalToSizedBufferVT ¶
func (m *ParseJsonRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ParseJsonRequest) MarshalToVT ¶
func (m *ParseJsonRequest) MarshalToVT(dAtA []byte) (int, error)
func (*ParseJsonRequest) MarshalVT ¶
func (m *ParseJsonRequest) MarshalVT() (dAtA []byte, err error)
func (*ParseJsonRequest) ProtoReflect ¶
func (x *ParseJsonRequest) ProtoReflect() protoreflect.Message
func (*ParseJsonRequest) SizeVT ¶
func (m *ParseJsonRequest) SizeVT() (n int)
func (*ParseJsonRequest) UnmarshalVT ¶
func (m *ParseJsonRequest) UnmarshalVT(dAtA []byte) error
type ParseJsonResponse ¶
type ParseJsonResponse struct { Response *Person `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
func (*ParseJsonResponse) GetResponse ¶
func (x *ParseJsonResponse) GetResponse() *Person
func (*ParseJsonResponse) MarshalToSizedBufferVT ¶
func (m *ParseJsonResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ParseJsonResponse) MarshalToVT ¶
func (m *ParseJsonResponse) MarshalToVT(dAtA []byte) (int, error)
func (*ParseJsonResponse) MarshalVT ¶
func (m *ParseJsonResponse) MarshalVT() (dAtA []byte, err error)
func (*ParseJsonResponse) ProtoReflect ¶
func (x *ParseJsonResponse) ProtoReflect() protoreflect.Message
func (*ParseJsonResponse) SizeVT ¶
func (m *ParseJsonResponse) SizeVT() (n int)
func (*ParseJsonResponse) UnmarshalVT ¶
func (m *ParseJsonResponse) UnmarshalVT(dAtA []byte) error
type ParserLibrary ¶
type ParserLibrary interface { ParseJson(context.Context, *ParseJsonRequest) (*ParseJsonResponse, error) }
Distributing host functions without plugin code go:plugin type=host module=json-parser
type Person ¶
type Person struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int64 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*Person) GetAge ¶
func (*Person) GetName ¶
func (*Person) MarshalToSizedBufferVT ¶
func (*Person) MarshalToVT ¶
func (*Person) MarshalVT ¶
func (*Person) ProtoReflect ¶
func (x *Person) ProtoReflect() protoreflect.Message
func (*Person) SizeVT ¶
func (*Person) UnmarshalVT ¶
Source Files ¶
library.pb.go library_host.pb.go library_vtproto.pb.go
- Version
- v0.8.0
- Published
- Jun 25, 2023
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 3 days ago –
Tools for package owners.