Documentation
¶
Index ¶
- Variables
- func StructpbValueToInput(value any, targetType reflect.Type) (any, error)
- type GRPCClient
- func (c *GRPCClient) CollectSpecs(ctx context.Context) ([]byte, error)
- func (c *GRPCClient) Do(ctx context.Context, task string, input *proto.Input) (Response, error)
- func (c *GRPCClient) GetTaskLockMode(task string) (proto.LockMode, error)
- func (c *GRPCClient) Help(task string) (map[string]string, error)
- func (c *GRPCClient) Name() (string, error)
- func (c *GRPCClient) Tasks() ([]string, error)
- func (c *GRPCClient) Version() (Version, error)
- type GRPCServer
- func (s *GRPCServer) CollectSpecs(ctx context.Context, req *empty.Empty) (*protoplugin.CollectSpecsResponse, error)
- func (s *GRPCServer) Do(ctx context.Context, req *protoplugin.DoRequest) (*protoplugin.DoResponse, error)
- func (s *GRPCServer) GetTaskLockMode(ctx context.Context, req *protoplugin.TaskLockModeRequest) (*protoplugin.TaskLockModeResponse, error)
- func (s *GRPCServer) Help(ctx context.Context, req *protoplugin.HelpRequest) (*protoplugin.HelpResponse, error)
- func (s *GRPCServer) Name(ctx context.Context, req *empty.Empty) (*protoplugin.NameResponse, error)
- func (s *GRPCServer) Tasks(ctx context.Context, req *empty.Empty) (*protoplugin.TasksResponse, error)
- func (s *GRPCServer) Version(ctx context.Context, req *empty.Empty) (*protoplugin.VersionResponse, error)
- type HCPlugin
- type Plugin
- type Response
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = goplugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "JACKADI_PLUGIN_MAGIC_COOKIE",
MagicCookieValue: "hv43fBvWLYYm0FWmur3V5KmJQXPR0woBg2F2MbyAcE8UuSCQGTlFJvTQUncCY0Xm",
}
Handshake is a common handshake that is shared by plugin and host.
Functions ¶
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func (*GRPCClient) CollectSpecs ¶
func (c *GRPCClient) CollectSpecs(ctx context.Context) ([]byte, error)
func (*GRPCClient) GetTaskLockMode ¶
func (c *GRPCClient) GetTaskLockMode(task string) (proto.LockMode, error)
func (*GRPCClient) Name ¶
func (c *GRPCClient) Name() (string, error)
func (*GRPCClient) Tasks ¶
func (c *GRPCClient) Tasks() ([]string, error)
func (*GRPCClient) Version ¶
func (c *GRPCClient) Version() (Version, error)
type GRPCServer ¶
type GRPCServer struct {
Impl Plugin
}
func (*GRPCServer) CollectSpecs ¶
func (s *GRPCServer) CollectSpecs(ctx context.Context, req *empty.Empty) (*protoplugin.CollectSpecsResponse, error)
func (*GRPCServer) Do ¶
func (s *GRPCServer) Do(ctx context.Context, req *protoplugin.DoRequest) (*protoplugin.DoResponse, error)
func (*GRPCServer) GetTaskLockMode ¶
func (s *GRPCServer) GetTaskLockMode(ctx context.Context, req *protoplugin.TaskLockModeRequest) (*protoplugin.TaskLockModeResponse, error)
func (*GRPCServer) Help ¶
func (s *GRPCServer) Help(ctx context.Context, req *protoplugin.HelpRequest) (*protoplugin.HelpResponse, error)
func (*GRPCServer) Name ¶
func (s *GRPCServer) Name(ctx context.Context, req *empty.Empty) (*protoplugin.NameResponse, error)
func (*GRPCServer) Tasks ¶
func (s *GRPCServer) Tasks(ctx context.Context, req *empty.Empty) (*protoplugin.TasksResponse, error)
func (*GRPCServer) Version ¶
func (s *GRPCServer) Version(ctx context.Context, req *empty.Empty) (*protoplugin.VersionResponse, error)
type HCPlugin ¶
func (*HCPlugin) GRPCClient ¶
func (*HCPlugin) GRPCClient(ctx context.Context, broker *goplugin.GRPCBroker, c *grpc.ClientConn) (any, error)
func (*HCPlugin) GRPCServer ¶
type Plugin ¶
type Plugin interface {
Name() (string, error)
Tasks() ([]string, error)
Help(task string) (map[string]string, error)
Version() (Version, error)
Do(ctx context.Context, task string, input *proto.Input) (Response, error)
CollectSpecs(ctx context.Context) ([]byte, error)
GetTaskLockMode(task string) (proto.LockMode, error)
}
Click to show internal directories.
Click to hide internal directories.