Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPluginProtocolServer(s grpc.ServiceRegistrar, srv PluginProtocolServer)
- type Client
- type ConfigResponse
- func (*ConfigResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigResponse) GetData() []byte
- func (x *ConfigResponse) GetSuccess() bool
- func (*ConfigResponse) ProtoMessage()
- func (x *ConfigResponse) ProtoReflect() protoreflect.Message
- func (x *ConfigResponse) Reset()
- func (x *ConfigResponse) String() string
- type Empty
- type ErrorMessage
- func (*ErrorMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorMessage) GetCode() int32
- func (x *ErrorMessage) GetData() []byte
- func (x *ErrorMessage) GetMessage() string
- func (*ErrorMessage) ProtoMessage()
- func (x *ErrorMessage) ProtoReflect() protoreflect.Message
- func (x *ErrorMessage) Reset()
- func (x *ErrorMessage) String() string
- type FunctionRequest
- func (*FunctionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *FunctionRequest) GetFunction() string
- func (x *FunctionRequest) GetIn() []*InTypes
- func (x *FunctionRequest) GetStruct() string
- func (*FunctionRequest) ProtoMessage()
- func (x *FunctionRequest) ProtoReflect() protoreflect.Message
- func (x *FunctionRequest) Reset()
- func (x *FunctionRequest) String() string
- type FunctionResponse
- func (*FunctionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FunctionResponse) GetClient() string
- func (x *FunctionResponse) GetData() []byte
- func (x *FunctionResponse) GetError() *ErrorMessage
- func (x *FunctionResponse) GetSuccess() bool
- func (*FunctionResponse) ProtoMessage()
- func (x *FunctionResponse) ProtoReflect() protoreflect.Message
- func (x *FunctionResponse) Reset()
- func (x *FunctionResponse) String() string
- type Handler
- type InItem
- type InTypes
- func (*InTypes) Descriptor() ([]byte, []int)deprecated
- func (x *InTypes) GetIn() []byte
- func (x *InTypes) GetIndex() int32
- func (x *InTypes) GetType() string
- func (*InTypes) ProtoMessage()
- func (x *InTypes) ProtoReflect() protoreflect.Message
- func (x *InTypes) Reset()
- func (x *InTypes) String() string
- type OutType
- func (*OutType) Descriptor() ([]byte, []int)deprecated
- func (x *OutType) GetIndex() int32
- func (x *OutType) GetOut() []byte
- func (x *OutType) GetType() string
- func (*OutType) ProtoMessage()
- func (x *OutType) ProtoReflect() protoreflect.Message
- func (x *OutType) Reset()
- func (x *OutType) String() string
- type PluginManagerInterface
- type PluginProtocolClient
- type PluginProtocolServer
- type Server
- func (s Server) CallFunction(ctx context.Context, req *FunctionRequest) (*FunctionResponse, error)
- func (s Server) HeartBeat(ctx context.Context, req *Empty) (*Empty, error)
- func (s Server) RequestConfig(ctx context.Context, req *Empty) (*ConfigResponse, error)
- func (s Server) Run() error
- func (s Server) Stat(ctx context.Context, req *Empty) (*StatResponse, error)
- type StatResponse
- type UnimplementedPluginProtocolServer
- func (UnimplementedPluginProtocolServer) CallFunction(context.Context, *FunctionRequest) (*FunctionResponse, error)
- func (UnimplementedPluginProtocolServer) HeartBeat(context.Context, *Empty) (*Empty, error)
- func (UnimplementedPluginProtocolServer) RequestConfig(context.Context, *Empty) (*ConfigResponse, error)
- func (UnimplementedPluginProtocolServer) Stat(context.Context, *Empty) (*StatResponse, error)
- type UnsafePluginProtocolServer
Constants ¶
const ( PluginProtocol_RequestConfig_FullMethodName = "/protocol.PluginProtocol/RequestConfig" PluginProtocol_CallFunction_FullMethodName = "/protocol.PluginProtocol/CallFunction" PluginProtocol_HeartBeat_FullMethodName = "/protocol.PluginProtocol/HeartBeat" PluginProtocol_Stat_FullMethodName = "/protocol.PluginProtocol/Stat" )
Variables ¶
var File_proto_protocol_proto protoreflect.FileDescriptor
var PluginProtocol_ServiceDesc = grpc.ServiceDesc{ ServiceName: "protocol.PluginProtocol", HandlerType: (*PluginProtocolServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RequestConfig", Handler: _PluginProtocol_RequestConfig_Handler, }, { MethodName: "CallFunction", Handler: _PluginProtocol_CallFunction_Handler, }, { MethodName: "HeartBeat", Handler: _PluginProtocol_HeartBeat_Handler, }, { MethodName: "Stat", Handler: _PluginProtocol_Stat_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/protocol.proto", }
PluginProtocol_ServiceDesc is the grpc.ServiceDesc for PluginProtocol service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPluginProtocolServer ¶
func RegisterPluginProtocolServer(s grpc.ServiceRegistrar, srv PluginProtocolServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConnectionStatus ¶
func (c *Client) ConnectionStatus() connectivity.State
func (*Client) WaitConnect ¶
func (c *Client) WaitConnect()
type ConfigResponse ¶
type ConfigResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ConfigResponse) Descriptor
deprecated
func (*ConfigResponse) Descriptor() ([]byte, []int)
Deprecated: Use ConfigResponse.ProtoReflect.Descriptor instead.
func (*ConfigResponse) GetData ¶
func (x *ConfigResponse) GetData() []byte
func (*ConfigResponse) GetSuccess ¶
func (x *ConfigResponse) GetSuccess() bool
func (*ConfigResponse) ProtoMessage ¶
func (*ConfigResponse) ProtoMessage()
func (*ConfigResponse) ProtoReflect ¶
func (x *ConfigResponse) ProtoReflect() protoreflect.Message
func (*ConfigResponse) Reset ¶
func (x *ConfigResponse) Reset()
func (*ConfigResponse) String ¶
func (x *ConfigResponse) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type ErrorMessage ¶
type ErrorMessage struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ErrorMessage) Descriptor
deprecated
func (*ErrorMessage) Descriptor() ([]byte, []int)
Deprecated: Use ErrorMessage.ProtoReflect.Descriptor instead.
func (*ErrorMessage) GetCode ¶
func (x *ErrorMessage) GetCode() int32
func (*ErrorMessage) GetData ¶
func (x *ErrorMessage) GetData() []byte
func (*ErrorMessage) GetMessage ¶
func (x *ErrorMessage) GetMessage() string
func (*ErrorMessage) ProtoMessage ¶
func (*ErrorMessage) ProtoMessage()
func (*ErrorMessage) ProtoReflect ¶
func (x *ErrorMessage) ProtoReflect() protoreflect.Message
func (*ErrorMessage) Reset ¶
func (x *ErrorMessage) Reset()
func (*ErrorMessage) String ¶
func (x *ErrorMessage) String() string
type FunctionRequest ¶
type FunctionRequest struct { In []*InTypes `protobuf:"bytes,1,rep,name=in,proto3" json:"in,omitempty"` Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"` Struct string `protobuf:"bytes,3,opt,name=struct,proto3" json:"struct,omitempty"` // contains filtered or unexported fields }
func (*FunctionRequest) Descriptor
deprecated
func (*FunctionRequest) Descriptor() ([]byte, []int)
Deprecated: Use FunctionRequest.ProtoReflect.Descriptor instead.
func (*FunctionRequest) GetFunction ¶
func (x *FunctionRequest) GetFunction() string
func (*FunctionRequest) GetIn ¶
func (x *FunctionRequest) GetIn() []*InTypes
func (*FunctionRequest) GetStruct ¶
func (x *FunctionRequest) GetStruct() string
func (*FunctionRequest) ProtoMessage ¶
func (*FunctionRequest) ProtoMessage()
func (*FunctionRequest) ProtoReflect ¶
func (x *FunctionRequest) ProtoReflect() protoreflect.Message
func (*FunctionRequest) Reset ¶
func (x *FunctionRequest) Reset()
func (*FunctionRequest) String ¶
func (x *FunctionRequest) String() string
type FunctionResponse ¶
type FunctionResponse struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` Client string `protobuf:"bytes,3,opt,name=client,proto3" json:"client,omitempty"` Error *ErrorMessage `protobuf:"bytes,4,opt,name=error,proto3,oneof" json:"error,omitempty"` // contains filtered or unexported fields }
func (*FunctionResponse) Descriptor
deprecated
func (*FunctionResponse) Descriptor() ([]byte, []int)
Deprecated: Use FunctionResponse.ProtoReflect.Descriptor instead.
func (*FunctionResponse) GetClient ¶
func (x *FunctionResponse) GetClient() string
func (*FunctionResponse) GetData ¶
func (x *FunctionResponse) GetData() []byte
func (*FunctionResponse) GetError ¶
func (x *FunctionResponse) GetError() *ErrorMessage
func (*FunctionResponse) GetSuccess ¶
func (x *FunctionResponse) GetSuccess() bool
func (*FunctionResponse) ProtoMessage ¶
func (*FunctionResponse) ProtoMessage()
func (*FunctionResponse) ProtoReflect ¶
func (x *FunctionResponse) ProtoReflect() protoreflect.Message
func (*FunctionResponse) Reset ¶
func (x *FunctionResponse) Reset()
func (*FunctionResponse) String ¶
func (x *FunctionResponse) String() string
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) HandleConn ¶
HandleConn processes the Conn stats.
type InTypes ¶
type InTypes struct { Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` In []byte `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*InTypes) Descriptor
deprecated
func (*InTypes) ProtoMessage ¶
func (*InTypes) ProtoMessage()
func (*InTypes) ProtoReflect ¶
func (x *InTypes) ProtoReflect() protoreflect.Message
type OutType ¶
type OutType struct { Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Out []byte `protobuf:"bytes,2,opt,name=out,proto3" json:"out,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*OutType) Descriptor
deprecated
func (*OutType) ProtoMessage ¶
func (*OutType) ProtoMessage()
func (*OutType) ProtoReflect ¶
func (x *OutType) ProtoReflect() protoreflect.Message
type PluginManagerInterface ¶
type PluginProtocolClient ¶
type PluginProtocolClient interface { RequestConfig(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConfigResponse, error) CallFunction(ctx context.Context, in *FunctionRequest, opts ...grpc.CallOption) (*FunctionResponse, error) HeartBeat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) Stat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StatResponse, error) }
PluginProtocolClient is the client API for PluginProtocol service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPluginProtocolClient ¶
func NewPluginProtocolClient(cc grpc.ClientConnInterface) PluginProtocolClient
type PluginProtocolServer ¶
type PluginProtocolServer interface { RequestConfig(context.Context, *Empty) (*ConfigResponse, error) CallFunction(context.Context, *FunctionRequest) (*FunctionResponse, error) HeartBeat(context.Context, *Empty) (*Empty, error) Stat(context.Context, *Empty) (*StatResponse, error) // contains filtered or unexported methods }
PluginProtocolServer is the server API for PluginProtocol service. All implementations must embed UnimplementedPluginProtocolServer for forward compatibility
type Server ¶
type Server struct { PluginProtocolServer UnimplementedPluginProtocolServer ConfigFunction func() map[string]interface{} Caller func(string, string, []*InTypes) any // contains filtered or unexported fields }
func NewServer ¶
func NewServer(ltype string, socket string, p PluginManagerInterface) (Server, error)
func (Server) CallFunction ¶
func (s Server) CallFunction(ctx context.Context, req *FunctionRequest) (*FunctionResponse, error)
func (Server) RequestConfig ¶
type StatResponse ¶
type StatResponse struct { Avgresponse int32 `protobuf:"varint,1,opt,name=avgresponse,proto3" json:"avgresponse,omitempty"` // contains filtered or unexported fields }
func (*StatResponse) Descriptor
deprecated
func (*StatResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatResponse.ProtoReflect.Descriptor instead.
func (*StatResponse) GetAvgresponse ¶
func (x *StatResponse) GetAvgresponse() int32
func (*StatResponse) ProtoMessage ¶
func (*StatResponse) ProtoMessage()
func (*StatResponse) ProtoReflect ¶
func (x *StatResponse) ProtoReflect() protoreflect.Message
func (*StatResponse) Reset ¶
func (x *StatResponse) Reset()
func (*StatResponse) String ¶
func (x *StatResponse) String() string
type UnimplementedPluginProtocolServer ¶
type UnimplementedPluginProtocolServer struct { }
UnimplementedPluginProtocolServer must be embedded to have forward compatible implementations.
func (UnimplementedPluginProtocolServer) CallFunction ¶
func (UnimplementedPluginProtocolServer) CallFunction(context.Context, *FunctionRequest) (*FunctionResponse, error)
func (UnimplementedPluginProtocolServer) RequestConfig ¶
func (UnimplementedPluginProtocolServer) RequestConfig(context.Context, *Empty) (*ConfigResponse, error)
func (UnimplementedPluginProtocolServer) Stat ¶
func (UnimplementedPluginProtocolServer) Stat(context.Context, *Empty) (*StatResponse, error)
type UnsafePluginProtocolServer ¶
type UnsafePluginProtocolServer interface {
// contains filtered or unexported methods
}
UnsafePluginProtocolServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginProtocolServer will result in compilation errors.