Documentation ¶
Index ¶
- Constants
- Variables
- func HandshakeConfig() plugin.HandshakeConfig
- func Log(format string, a ...any)
- func PluginMap() map[string]plugin.Plugin
- func RegisterOnstaticPluginServer(s grpc.ServiceRegistrar, srv OnstaticPluginServer)
- func Serve(server OnstaticPluginServer)
- func SignalChan() chan os.Signal
- type BasicServer
- func (b *BasicServer) Handle(ctx context.Context, req *HandleRequest) (*HandleResponse, error)
- func (*BasicServer) Name(context.Context, *EmptyMessage) (*NameResponse, error)
- func (b *BasicServer) RegisterHandler(method HTTPMethod, path string, callback http.HandlerFunc)
- func (*BasicServer) Start(context.Context, *EmptyMessage) (*EmptyMessage, error)
- func (*BasicServer) Stop(context.Context, *EmptyMessage) (*EmptyMessage, error)
- type EmptyMessage
- type HTTPMethod
- type HandleRequest
- func (*HandleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HandleRequest) GetBody() string
- func (x *HandleRequest) GetHeader() []*Header
- func (x *HandleRequest) GetPath() string
- func (*HandleRequest) ProtoMessage()
- func (x *HandleRequest) ProtoReflect() protoreflect.Message
- func (x *HandleRequest) Reset()
- func (x *HandleRequest) String() string
- type HandleResponse
- func (*HandleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HandleResponse) GetBody() string
- func (x *HandleResponse) GetHeader() []*Header
- func (*HandleResponse) ProtoMessage()
- func (x *HandleResponse) ProtoReflect() protoreflect.Message
- func (x *HandleResponse) Reset()
- func (x *HandleResponse) String() string
- type Header
- type NameResponse
- type OnstaticPluginClient
- type OnstaticPluginServer
- type UnimplementedOnstaticPluginServer
- func (UnimplementedOnstaticPluginServer) Handle(context.Context, *HandleRequest) (*HandleResponse, error)
- func (UnimplementedOnstaticPluginServer) Name(context.Context, *EmptyMessage) (*NameResponse, error)
- func (UnimplementedOnstaticPluginServer) Start(context.Context, *EmptyMessage) (*EmptyMessage, error)
- func (UnimplementedOnstaticPluginServer) Stop(context.Context, *EmptyMessage) (*EmptyMessage, error)
- type UnsafeOnstaticPluginServer
Constants ¶
const ( EntryPoint = "EntryPoint" NameArg = "--name" HTTPMethodGET HTTPMethod = http.MethodGet HTTPMethodPOST HTTPMethod = http.MethodPost )
Variables ¶
var ErrPluginNotHandledPath = errors.New("not found path")
var File_pluginapi_plugin_proto protoreflect.FileDescriptor
var OnstaticPlugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugin.OnstaticPlugin", HandlerType: (*OnstaticPluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Name", Handler: _OnstaticPlugin_Name_Handler, }, { MethodName: "Start", Handler: _OnstaticPlugin_Start_Handler, }, { MethodName: "Stop", Handler: _OnstaticPlugin_Stop_Handler, }, { MethodName: "Handle", Handler: _OnstaticPlugin_Handle_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pluginapi/plugin.proto", }
OnstaticPlugin_ServiceDesc is the grpc.ServiceDesc for OnstaticPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func HandshakeConfig ¶
func HandshakeConfig() plugin.HandshakeConfig
func RegisterOnstaticPluginServer ¶
func RegisterOnstaticPluginServer(s grpc.ServiceRegistrar, srv OnstaticPluginServer)
func Serve ¶
func Serve(server OnstaticPluginServer)
Serve can call from only plugin side. Host must not call this func.
func SignalChan ¶
Types ¶
type BasicServer ¶
type BasicServer struct { OnstaticPluginServer // contains filtered or unexported fields }
func (*BasicServer) Handle ¶
func (b *BasicServer) Handle(ctx context.Context, req *HandleRequest) (*HandleResponse, error)
func (*BasicServer) Name ¶
func (*BasicServer) Name(context.Context, *EmptyMessage) (*NameResponse, error)
func (*BasicServer) RegisterHandler ¶
func (b *BasicServer) RegisterHandler(method HTTPMethod, path string, callback http.HandlerFunc)
func (*BasicServer) Start ¶
func (*BasicServer) Start(context.Context, *EmptyMessage) (*EmptyMessage, error)
func (*BasicServer) Stop ¶
func (*BasicServer) Stop(context.Context, *EmptyMessage) (*EmptyMessage, error)
type EmptyMessage ¶
type EmptyMessage struct {
// contains filtered or unexported fields
}
func (*EmptyMessage) Descriptor
deprecated
func (*EmptyMessage) Descriptor() ([]byte, []int)
Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead.
func (*EmptyMessage) ProtoMessage ¶
func (*EmptyMessage) ProtoMessage()
func (*EmptyMessage) ProtoReflect ¶
func (x *EmptyMessage) ProtoReflect() protoreflect.Message
func (*EmptyMessage) Reset ¶
func (x *EmptyMessage) Reset()
func (*EmptyMessage) String ¶
func (x *EmptyMessage) String() string
type HTTPMethod ¶
type HTTPMethod string
type HandleRequest ¶
type HandleRequest struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Header []*Header `protobuf:"bytes,2,rep,name=header,proto3" json:"header,omitempty"` Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*HandleRequest) Descriptor
deprecated
func (*HandleRequest) Descriptor() ([]byte, []int)
Deprecated: Use HandleRequest.ProtoReflect.Descriptor instead.
func (*HandleRequest) GetBody ¶
func (x *HandleRequest) GetBody() string
func (*HandleRequest) GetHeader ¶
func (x *HandleRequest) GetHeader() []*Header
func (*HandleRequest) GetPath ¶
func (x *HandleRequest) GetPath() string
func (*HandleRequest) ProtoMessage ¶
func (*HandleRequest) ProtoMessage()
func (*HandleRequest) ProtoReflect ¶
func (x *HandleRequest) ProtoReflect() protoreflect.Message
func (*HandleRequest) Reset ¶
func (x *HandleRequest) Reset()
func (*HandleRequest) String ¶
func (x *HandleRequest) String() string
type HandleResponse ¶
type HandleResponse struct { Header []*Header `protobuf:"bytes,1,rep,name=header,proto3" json:"header,omitempty"` Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*HandleResponse) Descriptor
deprecated
func (*HandleResponse) Descriptor() ([]byte, []int)
Deprecated: Use HandleResponse.ProtoReflect.Descriptor instead.
func (*HandleResponse) GetBody ¶
func (x *HandleResponse) GetBody() string
func (*HandleResponse) GetHeader ¶
func (x *HandleResponse) GetHeader() []*Header
func (*HandleResponse) ProtoMessage ¶
func (*HandleResponse) ProtoMessage()
func (*HandleResponse) ProtoReflect ¶
func (x *HandleResponse) ProtoReflect() protoreflect.Message
func (*HandleResponse) Reset ¶
func (x *HandleResponse) Reset()
func (*HandleResponse) String ¶
func (x *HandleResponse) String() string
type Header ¶
type Header struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Header) Descriptor
deprecated
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type NameResponse ¶
type NameResponse struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*NameResponse) Descriptor
deprecated
func (*NameResponse) Descriptor() ([]byte, []int)
Deprecated: Use NameResponse.ProtoReflect.Descriptor instead.
func (*NameResponse) GetName ¶
func (x *NameResponse) GetName() string
func (*NameResponse) ProtoMessage ¶
func (*NameResponse) ProtoMessage()
func (*NameResponse) ProtoReflect ¶
func (x *NameResponse) ProtoReflect() protoreflect.Message
func (*NameResponse) Reset ¶
func (x *NameResponse) Reset()
func (*NameResponse) String ¶
func (x *NameResponse) String() string
type OnstaticPluginClient ¶
type OnstaticPluginClient interface { Name(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*NameResponse, error) Start(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) Stop(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*EmptyMessage, error) Handle(ctx context.Context, in *HandleRequest, opts ...grpc.CallOption) (*HandleResponse, error) }
OnstaticPluginClient is the client API for OnstaticPlugin 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 NewOnstaticPluginClient ¶
func NewOnstaticPluginClient(cc grpc.ClientConnInterface) OnstaticPluginClient
type OnstaticPluginServer ¶
type OnstaticPluginServer interface { Name(context.Context, *EmptyMessage) (*NameResponse, error) Start(context.Context, *EmptyMessage) (*EmptyMessage, error) Stop(context.Context, *EmptyMessage) (*EmptyMessage, error) Handle(context.Context, *HandleRequest) (*HandleResponse, error) // contains filtered or unexported methods }
OnstaticPluginServer is the server API for OnstaticPlugin service. All implementations must embed UnimplementedOnstaticPluginServer for forward compatibility
type UnimplementedOnstaticPluginServer ¶
type UnimplementedOnstaticPluginServer struct { }
UnimplementedOnstaticPluginServer must be embedded to have forward compatible implementations.
func (UnimplementedOnstaticPluginServer) Handle ¶
func (UnimplementedOnstaticPluginServer) Handle(context.Context, *HandleRequest) (*HandleResponse, error)
func (UnimplementedOnstaticPluginServer) Name ¶
func (UnimplementedOnstaticPluginServer) Name(context.Context, *EmptyMessage) (*NameResponse, error)
func (UnimplementedOnstaticPluginServer) Start ¶
func (UnimplementedOnstaticPluginServer) Start(context.Context, *EmptyMessage) (*EmptyMessage, error)
func (UnimplementedOnstaticPluginServer) Stop ¶
func (UnimplementedOnstaticPluginServer) Stop(context.Context, *EmptyMessage) (*EmptyMessage, error)
type UnsafeOnstaticPluginServer ¶
type UnsafeOnstaticPluginServer interface {
// contains filtered or unexported methods
}
UnsafeOnstaticPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OnstaticPluginServer will result in compilation errors.