Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer)
- func Serve(impl PluginImpl)
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteRequest) GetConfig() map[string]string
- func (x *ExecuteRequest) GetPluginId() string
- func (*ExecuteRequest) ProtoMessage()
- func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
- func (x *ExecuteRequest) Reset()
- func (x *ExecuteRequest) String() string
- type ExecuteResponse
- func (*ExecuteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteResponse) GetMessage() string
- func (x *ExecuteResponse) GetOutput() string
- func (x *ExecuteResponse) GetSuccess() bool
- func (*ExecuteResponse) ProtoMessage()
- func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteResponse) Reset()
- func (x *ExecuteResponse) String() string
- type PluginClient
- type PluginImpl
- type PluginServer
- type PluginWrapper
- func (p *PluginWrapper) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
- func (p *PluginWrapper) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)
- func (p *PluginWrapper) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
- func (p *PluginWrapper) Server(broker *plugin.MuxBroker) (interface{}, error)
- type PluginWrapperGRPC
- type UnimplementedPluginServer
- type UnsafePluginServer
Constants ¶
const (
Plugin_Execute_FullMethodName = "/plugin.Plugin/Execute"
)
Variables ¶
var File_plugin_proto protoreflect.FileDescriptor
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "FERN_PLUGIN",
MagicCookieValue: "fern_plugin_interface_v1",
}
var Plugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugin.Plugin", HandlerType: (*PluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Execute", Handler: _Plugin_Execute_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugin.proto", }
Plugin_ServiceDesc is the grpc.ServiceDesc for Plugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPluginServer ¶
func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer)
func Serve ¶
func Serve(impl PluginImpl)
Types ¶
type ExecuteRequest ¶
type ExecuteRequest struct {
PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"`
Config map[string]string `` /* 139-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*ExecuteRequest) Descriptor
deprecated
func (*ExecuteRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.
func (*ExecuteRequest) GetConfig ¶
func (x *ExecuteRequest) GetConfig() map[string]string
func (*ExecuteRequest) GetPluginId ¶
func (x *ExecuteRequest) GetPluginId() string
func (*ExecuteRequest) ProtoMessage ¶
func (*ExecuteRequest) ProtoMessage()
func (*ExecuteRequest) ProtoReflect ¶
func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
func (*ExecuteRequest) Reset ¶
func (x *ExecuteRequest) Reset()
func (*ExecuteRequest) String ¶
func (x *ExecuteRequest) String() string
type ExecuteResponse ¶
type ExecuteResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"`
// contains filtered or unexported fields
}
func (*ExecuteResponse) Descriptor
deprecated
func (*ExecuteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.
func (*ExecuteResponse) GetMessage ¶
func (x *ExecuteResponse) GetMessage() string
func (*ExecuteResponse) GetOutput ¶
func (x *ExecuteResponse) GetOutput() string
func (*ExecuteResponse) GetSuccess ¶
func (x *ExecuteResponse) GetSuccess() bool
func (*ExecuteResponse) ProtoMessage ¶
func (*ExecuteResponse) ProtoMessage()
func (*ExecuteResponse) ProtoReflect ¶
func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
func (*ExecuteResponse) Reset ¶
func (x *ExecuteResponse) Reset()
func (*ExecuteResponse) String ¶
func (x *ExecuteResponse) String() string
type PluginClient ¶
type PluginClient interface {
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
}
PluginClient is the client API for Plugin 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 NewPluginClient ¶
func NewPluginClient(cc grpc.ClientConnInterface) PluginClient
type PluginImpl ¶
type PluginImpl interface {
Execute(ctx context.Context, req *ExecuteRequest) (*ExecuteResponse, error)
}
type PluginServer ¶
type PluginServer interface {
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
// contains filtered or unexported methods
}
PluginServer is the server API for Plugin service. All implementations must embed UnimplementedPluginServer for forward compatibility.
type PluginWrapper ¶
type PluginWrapper struct {
Impl PluginImpl
}
func (*PluginWrapper) GRPCClient ¶
func (p *PluginWrapper) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)
func (*PluginWrapper) GRPCServer ¶
func (p *PluginWrapper) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type PluginWrapperGRPC ¶
type PluginWrapperGRPC struct {
UnimplementedPluginServer
// contains filtered or unexported fields
}
func (*PluginWrapperGRPC) Execute ¶
func (s *PluginWrapperGRPC) Execute(ctx context.Context, req *ExecuteRequest) (*ExecuteResponse, error)
type UnimplementedPluginServer ¶
type UnimplementedPluginServer struct{}
UnimplementedPluginServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedPluginServer) Execute ¶
func (UnimplementedPluginServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
type UnsafePluginServer ¶
type UnsafePluginServer interface {
// contains filtered or unexported methods
}
UnsafePluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginServer will result in compilation errors.