Documentation ¶
Overview ¶
this file implemented wrap/unwrap between go types and proto Any type
Index ¶
- Constants
- Variables
- func RegisterType(v any)
- func WazeroModuleConfig(moduleConfig wazero.ModuleConfig) wazeroConfigOption
- func WazeroRuntime(newRuntime WazeroNewRuntime) wazeroConfigOption
- type Any
- func (x *Any) GetType() string
- func (x *Any) GetValue() []byte
- func (m *Any) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Any) MarshalToVT(dAtA []byte) (int, error)
- func (m *Any) MarshalVT() (dAtA []byte, err error)
- func (x *Any) ProtoReflect() protoreflect.Message
- func (m *Any) SizeVT() (n int)
- func (m *Any) UnmarshalVT(dAtA []byte) error
- func (v *Any) Unwrap() (value any, err error)
- type Device
- func (x *Device) GetHost() string
- func (x *Device) GetId() int64
- func (x *Device) GetType() string
- func (m *Device) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Device) MarshalToVT(dAtA []byte) (int, error)
- func (m *Device) MarshalVT() (dAtA []byte, err error)
- func (x *Device) ProtoReflect() protoreflect.Message
- func (m *Device) SizeVT() (n int)
- func (m *Device) UnmarshalVT(dAtA []byte) error
- type DeviceCustomEvent
- func (x *DeviceCustomEvent) GetArgs() []*Any
- func (x *DeviceCustomEvent) GetDevice() *Device
- func (x *DeviceCustomEvent) GetEvent() string
- func (m *DeviceCustomEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *DeviceCustomEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *DeviceCustomEvent) MarshalVT() (dAtA []byte, err error)
- func (x *DeviceCustomEvent) ProtoReflect() protoreflect.Message
- func (m *DeviceCustomEvent) SizeVT() (n int)
- func (m *DeviceCustomEvent) UnmarshalVT(dAtA []byte) error
- type DeviceEvent
- func (x *DeviceEvent) GetArgs() []*Any
- func (x *DeviceEvent) GetDevice() *Device
- func (x *DeviceEvent) GetEvent() string
- func (m *DeviceEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *DeviceEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *DeviceEvent) MarshalVT() (dAtA []byte, err error)
- func (x *DeviceEvent) ProtoReflect() protoreflect.Message
- func (m *DeviceEvent) SizeVT() (n int)
- func (m *DeviceEvent) UnmarshalVT(dAtA []byte) error
- type DeviceJoinEvent
- func (x *DeviceJoinEvent) GetDevice() *Device
- func (m *DeviceJoinEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *DeviceJoinEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *DeviceJoinEvent) MarshalVT() (dAtA []byte, err error)
- func (x *DeviceJoinEvent) ProtoReflect() protoreflect.Message
- func (m *DeviceJoinEvent) SizeVT() (n int)
- func (m *DeviceJoinEvent) UnmarshalVT(dAtA []byte) error
- type DeviceLeaveEvent
- func (x *DeviceLeaveEvent) GetDevice() *Device
- func (m *DeviceLeaveEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *DeviceLeaveEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *DeviceLeaveEvent) MarshalVT() (dAtA []byte, err error)
- func (x *DeviceLeaveEvent) ProtoReflect() protoreflect.Message
- func (m *DeviceLeaveEvent) SizeVT() (n int)
- func (m *DeviceLeaveEvent) UnmarshalVT(dAtA []byte) error
- type Empty
- func (m *Empty) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Empty) MarshalToVT(dAtA []byte) (int, error)
- func (m *Empty) MarshalVT() (dAtA []byte, err error)
- func (x *Empty) ProtoReflect() protoreflect.Message
- func (m *Empty) SizeVT() (n int)
- func (m *Empty) UnmarshalVT(dAtA []byte) error
- type FireEventReq
- func (x *FireEventReq) GetData() map[string]*Any
- func (x *FireEventReq) GetTarget() *Device
- func (m *FireEventReq) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *FireEventReq) MarshalToVT(dAtA []byte) (int, error)
- func (m *FireEventReq) MarshalVT() (dAtA []byte, err error)
- func (x *FireEventReq) ProtoReflect() protoreflect.Message
- func (m *FireEventReq) SizeVT() (n int)
- func (m *FireEventReq) UnmarshalVT(dAtA []byte) error
- type Hook
- type HookAPI
- type HookLoadEvent
- func (x *HookLoadEvent) GetReload() bool
- func (m *HookLoadEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HookLoadEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *HookLoadEvent) MarshalVT() (dAtA []byte, err error)
- func (x *HookLoadEvent) ProtoReflect() protoreflect.Message
- func (m *HookLoadEvent) SizeVT() (n int)
- func (m *HookLoadEvent) UnmarshalVT(dAtA []byte) error
- type HookMetadata
- func (x *HookMetadata) GetId() string
- func (x *HookMetadata) GetVersion() string
- func (m *HookMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HookMetadata) MarshalToVT(dAtA []byte) (int, error)
- func (m *HookMetadata) MarshalVT() (dAtA []byte, err error)
- func (x *HookMetadata) ProtoReflect() protoreflect.Message
- func (m *HookMetadata) SizeVT() (n int)
- func (m *HookMetadata) UnmarshalVT(dAtA []byte) error
- type HookPlugin
- type HookUnloadEvent
- func (m *HookUnloadEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HookUnloadEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *HookUnloadEvent) MarshalVT() (dAtA []byte, err error)
- func (x *HookUnloadEvent) ProtoReflect() protoreflect.Message
- func (m *HookUnloadEvent) SizeVT() (n int)
- func (m *HookUnloadEvent) UnmarshalVT(dAtA []byte) error
- type UnknownTypeErr
- type UnsupportTypeErr
- type WazeroConfig
- type WazeroNewRuntime
Constants ¶
View Source
const HookPluginAPIVersion = 1
Variables ¶
View Source
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
View Source
var ErrIncorrectFormat = errors.New("Incorrect format")
Functions ¶
func RegisterType ¶
func RegisterType(v any)
func WazeroModuleConfig ¶
func WazeroModuleConfig(moduleConfig wazero.ModuleConfig) wazeroConfigOption
func WazeroRuntime ¶
func WazeroRuntime(newRuntime WazeroNewRuntime) wazeroConfigOption
Types ¶
type Any ¶
type Any struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
will use "encoding/gob" package to encode/decode data
func (*Any) ProtoReflect ¶
func (x *Any) ProtoReflect() protoreflect.Message
func (*Any) UnmarshalVT ¶
type Device ¶
type Device struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Device) MarshalToSizedBufferVT ¶
func (*Device) ProtoReflect ¶
func (x *Device) ProtoReflect() protoreflect.Message
func (*Device) UnmarshalVT ¶
type DeviceCustomEvent ¶
type DeviceCustomEvent struct { Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` Args []*Any `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` // contains filtered or unexported fields }
func (*DeviceCustomEvent) GetArgs ¶
func (x *DeviceCustomEvent) GetArgs() []*Any
func (*DeviceCustomEvent) GetDevice ¶
func (x *DeviceCustomEvent) GetDevice() *Device
func (*DeviceCustomEvent) GetEvent ¶
func (x *DeviceCustomEvent) GetEvent() string
func (*DeviceCustomEvent) MarshalToSizedBufferVT ¶
func (m *DeviceCustomEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*DeviceCustomEvent) MarshalToVT ¶
func (m *DeviceCustomEvent) MarshalToVT(dAtA []byte) (int, error)
func (*DeviceCustomEvent) MarshalVT ¶
func (m *DeviceCustomEvent) MarshalVT() (dAtA []byte, err error)
func (*DeviceCustomEvent) ProtoReflect ¶
func (x *DeviceCustomEvent) ProtoReflect() protoreflect.Message
func (*DeviceCustomEvent) SizeVT ¶
func (m *DeviceCustomEvent) SizeVT() (n int)
func (*DeviceCustomEvent) UnmarshalVT ¶
func (m *DeviceCustomEvent) UnmarshalVT(dAtA []byte) error
type DeviceEvent ¶
type DeviceEvent struct { Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` Args []*Any `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` // contains filtered or unexported fields }
func (*DeviceEvent) GetArgs ¶
func (x *DeviceEvent) GetArgs() []*Any
func (*DeviceEvent) GetDevice ¶
func (x *DeviceEvent) GetDevice() *Device
func (*DeviceEvent) GetEvent ¶
func (x *DeviceEvent) GetEvent() string
func (*DeviceEvent) MarshalToSizedBufferVT ¶
func (m *DeviceEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*DeviceEvent) MarshalToVT ¶
func (m *DeviceEvent) MarshalToVT(dAtA []byte) (int, error)
func (*DeviceEvent) MarshalVT ¶
func (m *DeviceEvent) MarshalVT() (dAtA []byte, err error)
func (*DeviceEvent) ProtoReflect ¶
func (x *DeviceEvent) ProtoReflect() protoreflect.Message
func (*DeviceEvent) SizeVT ¶
func (m *DeviceEvent) SizeVT() (n int)
func (*DeviceEvent) UnmarshalVT ¶
func (m *DeviceEvent) UnmarshalVT(dAtA []byte) error
type DeviceJoinEvent ¶
type DeviceJoinEvent struct { Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` // contains filtered or unexported fields }
func (*DeviceJoinEvent) GetDevice ¶
func (x *DeviceJoinEvent) GetDevice() *Device
func (*DeviceJoinEvent) MarshalToSizedBufferVT ¶
func (m *DeviceJoinEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*DeviceJoinEvent) MarshalToVT ¶
func (m *DeviceJoinEvent) MarshalToVT(dAtA []byte) (int, error)
func (*DeviceJoinEvent) MarshalVT ¶
func (m *DeviceJoinEvent) MarshalVT() (dAtA []byte, err error)
func (*DeviceJoinEvent) ProtoReflect ¶
func (x *DeviceJoinEvent) ProtoReflect() protoreflect.Message
func (*DeviceJoinEvent) SizeVT ¶
func (m *DeviceJoinEvent) SizeVT() (n int)
func (*DeviceJoinEvent) UnmarshalVT ¶
func (m *DeviceJoinEvent) UnmarshalVT(dAtA []byte) error
type DeviceLeaveEvent ¶
type DeviceLeaveEvent struct { Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` // contains filtered or unexported fields }
func (*DeviceLeaveEvent) GetDevice ¶
func (x *DeviceLeaveEvent) GetDevice() *Device
func (*DeviceLeaveEvent) MarshalToSizedBufferVT ¶
func (m *DeviceLeaveEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*DeviceLeaveEvent) MarshalToVT ¶
func (m *DeviceLeaveEvent) MarshalToVT(dAtA []byte) (int, error)
func (*DeviceLeaveEvent) MarshalVT ¶
func (m *DeviceLeaveEvent) MarshalVT() (dAtA []byte, err error)
func (*DeviceLeaveEvent) ProtoReflect ¶
func (x *DeviceLeaveEvent) ProtoReflect() protoreflect.Message
func (*DeviceLeaveEvent) SizeVT ¶
func (m *DeviceLeaveEvent) SizeVT() (n int)
func (*DeviceLeaveEvent) UnmarshalVT ¶
func (m *DeviceLeaveEvent) UnmarshalVT(dAtA []byte) error
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) MarshalToSizedBufferVT ¶
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
func (*Empty) UnmarshalVT ¶
type FireEventReq ¶
type FireEventReq struct { Target *Device `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` Data map[string]*Any `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*FireEventReq) GetData ¶
func (x *FireEventReq) GetData() map[string]*Any
func (*FireEventReq) GetTarget ¶
func (x *FireEventReq) GetTarget() *Device
func (*FireEventReq) MarshalToSizedBufferVT ¶
func (m *FireEventReq) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*FireEventReq) MarshalToVT ¶
func (m *FireEventReq) MarshalToVT(dAtA []byte) (int, error)
func (*FireEventReq) MarshalVT ¶
func (m *FireEventReq) MarshalVT() (dAtA []byte, err error)
func (*FireEventReq) ProtoReflect ¶
func (x *FireEventReq) ProtoReflect() protoreflect.Message
func (*FireEventReq) SizeVT ¶
func (m *FireEventReq) SizeVT() (n int)
func (*FireEventReq) UnmarshalVT ¶
func (m *FireEventReq) UnmarshalVT(dAtA []byte) error
type Hook ¶
type Hook interface { Metadata(context.Context, *Empty) (*HookMetadata, error) OnLoad(context.Context, *HookLoadEvent) (*Empty, error) OnUnload(context.Context, *HookUnloadEvent) (*Empty, error) OnDeviceJoin(context.Context, *DeviceJoinEvent) (*Empty, error) OnDeviceLeave(context.Context, *DeviceLeaveEvent) (*Empty, error) OnDeviceEvent(context.Context, *DeviceEvent) (*Empty, error) OnDeviceCustomEvent(context.Context, *DeviceCustomEvent) (*Empty, error) }
go:plugin type=plugin version=1
type HookAPI ¶
type HookAPI interface {
FireEvent(context.Context, *FireEventReq) (*Empty, error)
}
go:plugin type=host version=1
type HookLoadEvent ¶
type HookLoadEvent struct { Reload bool `protobuf:"varint,1,opt,name=reload,proto3" json:"reload,omitempty"` // contains filtered or unexported fields }
func (*HookLoadEvent) GetReload ¶
func (x *HookLoadEvent) GetReload() bool
func (*HookLoadEvent) MarshalToSizedBufferVT ¶
func (m *HookLoadEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HookLoadEvent) MarshalToVT ¶
func (m *HookLoadEvent) MarshalToVT(dAtA []byte) (int, error)
func (*HookLoadEvent) MarshalVT ¶
func (m *HookLoadEvent) MarshalVT() (dAtA []byte, err error)
func (*HookLoadEvent) ProtoReflect ¶
func (x *HookLoadEvent) ProtoReflect() protoreflect.Message
func (*HookLoadEvent) SizeVT ¶
func (m *HookLoadEvent) SizeVT() (n int)
func (*HookLoadEvent) UnmarshalVT ¶
func (m *HookLoadEvent) UnmarshalVT(dAtA []byte) error
type HookMetadata ¶
type HookMetadata struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func (*HookMetadata) GetId ¶
func (x *HookMetadata) GetId() string
func (*HookMetadata) GetVersion ¶
func (x *HookMetadata) GetVersion() string
func (*HookMetadata) MarshalToSizedBufferVT ¶
func (m *HookMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HookMetadata) MarshalToVT ¶
func (m *HookMetadata) MarshalToVT(dAtA []byte) (int, error)
func (*HookMetadata) MarshalVT ¶
func (m *HookMetadata) MarshalVT() (dAtA []byte, err error)
func (*HookMetadata) ProtoReflect ¶
func (x *HookMetadata) ProtoReflect() protoreflect.Message
func (*HookMetadata) SizeVT ¶
func (m *HookMetadata) SizeVT() (n int)
func (*HookMetadata) UnmarshalVT ¶
func (m *HookMetadata) UnmarshalVT(dAtA []byte) error
type HookPlugin ¶
type HookPlugin struct {
// contains filtered or unexported fields
}
func NewHookPlugin ¶
func NewHookPlugin(ctx context.Context, opts ...wazeroConfigOption) (*HookPlugin, error)
type HookUnloadEvent ¶
type HookUnloadEvent struct {
// contains filtered or unexported fields
}
func (*HookUnloadEvent) MarshalToSizedBufferVT ¶
func (m *HookUnloadEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HookUnloadEvent) MarshalToVT ¶
func (m *HookUnloadEvent) MarshalToVT(dAtA []byte) (int, error)
func (*HookUnloadEvent) MarshalVT ¶
func (m *HookUnloadEvent) MarshalVT() (dAtA []byte, err error)
func (*HookUnloadEvent) ProtoReflect ¶
func (x *HookUnloadEvent) ProtoReflect() protoreflect.Message
func (*HookUnloadEvent) SizeVT ¶
func (m *HookUnloadEvent) SizeVT() (n int)
func (*HookUnloadEvent) UnmarshalVT ¶
func (m *HookUnloadEvent) UnmarshalVT(dAtA []byte) error
type UnknownTypeErr ¶
type UnknownTypeErr struct {
Type string
}
func (*UnknownTypeErr) Error ¶
func (e *UnknownTypeErr) Error() string
type UnsupportTypeErr ¶
func (*UnsupportTypeErr) Error ¶
func (e *UnsupportTypeErr) Error() string
type WazeroConfig ¶
type WazeroConfig struct {
// contains filtered or unexported fields
}
type WazeroNewRuntime ¶
func DefaultWazeroRuntime ¶
func DefaultWazeroRuntime() WazeroNewRuntime
Click to show internal directories.
Click to hide internal directories.