Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDSPluginServer(s grpc.ServiceRegistrar, srv DSPluginServer)
- type DSPlugin
- type DSPluginClient
- type DSPluginServer
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteRequest) GetArgs() []string
- func (x *ExecuteRequest) GetEnv() map[string]string
- func (x *ExecuteRequest) GetOperation() 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) GetError() string
- func (x *ExecuteResponse) GetExitCode() int32
- func (x *ExecuteResponse) GetStderr() string
- func (x *ExecuteResponse) GetStdout() string
- func (*ExecuteResponse) ProtoMessage()
- func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteResponse) Reset()
- func (x *ExecuteResponse) String() string
- type GRPCClient
- func (m *GRPCClient) Execute(ctx context.Context, operation string, args []string, env map[string]string) (*types.ExecutionResult, error)
- func (m *GRPCClient) GetMetadata(ctx context.Context) (*types.PluginMetadata, error)
- func (m *GRPCClient) GetSchema(ctx context.Context) (*types.PluginSchema, error)
- func (m *GRPCClient) ValidateConfig(ctx context.Context, config map[string]interface{}) error
- type GRPCServer
- func (m *GRPCServer) Execute(ctx context.Context, req *ExecuteRequest) (*ExecuteResponse, error)
- func (m *GRPCServer) GetMetadata(ctx context.Context, req *GetMetadataRequest) (*GetMetadataResponse, error)
- func (m *GRPCServer) GetSchema(ctx context.Context, req *GetSchemaRequest) (*GetSchemaResponse, error)
- func (m *GRPCServer) ValidateConfig(ctx context.Context, req *ValidateConfigRequest) (*ValidateConfigResponse, error)
- type GetMetadataRequest
- type GetMetadataResponse
- func (*GetMetadataResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetMetadataResponse) GetConfig() map[string]string
- func (x *GetMetadataResponse) GetDescription() string
- func (x *GetMetadataResponse) GetName() string
- func (x *GetMetadataResponse) GetOperations() []string
- func (x *GetMetadataResponse) GetPlatform() *Platform
- func (x *GetMetadataResponse) GetVersion() string
- func (*GetMetadataResponse) ProtoMessage()
- func (x *GetMetadataResponse) ProtoReflect() protoreflect.Message
- func (x *GetMetadataResponse) Reset()
- func (x *GetMetadataResponse) String() string
- type GetSchemaRequest
- type GetSchemaResponse
- func (*GetSchemaResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSchemaResponse) GetProperties() map[string]*SchemaProperty
- func (x *GetSchemaResponse) GetVersion() string
- func (*GetSchemaResponse) ProtoMessage()
- func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message
- func (x *GetSchemaResponse) Reset()
- func (x *GetSchemaResponse) String() string
- type Platform
- type SchemaProperty
- func (*SchemaProperty) Descriptor() ([]byte, []int)deprecated
- func (x *SchemaProperty) GetDefault() string
- func (x *SchemaProperty) GetDescription() string
- func (x *SchemaProperty) GetRequired() bool
- func (x *SchemaProperty) GetType() string
- func (*SchemaProperty) ProtoMessage()
- func (x *SchemaProperty) ProtoReflect() protoreflect.Message
- func (x *SchemaProperty) Reset()
- func (x *SchemaProperty) String() string
- type UnimplementedDSPluginServer
- func (UnimplementedDSPluginServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
- func (UnimplementedDSPluginServer) GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error)
- func (UnimplementedDSPluginServer) GetSchema(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error)
- func (UnimplementedDSPluginServer) ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
- type UnsafeDSPluginServer
- type ValidateConfigRequest
- func (*ValidateConfigRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateConfigRequest) GetConfig() map[string]string
- func (*ValidateConfigRequest) ProtoMessage()
- func (x *ValidateConfigRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateConfigRequest) Reset()
- func (x *ValidateConfigRequest) String() string
- type ValidateConfigResponse
- func (*ValidateConfigResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateConfigResponse) GetError() string
- func (x *ValidateConfigResponse) GetValid() bool
- func (*ValidateConfigResponse) ProtoMessage()
- func (x *ValidateConfigResponse) ProtoReflect() protoreflect.Message
- func (x *ValidateConfigResponse) Reset()
- func (x *ValidateConfigResponse) String() string
Constants ¶
const ( DSPlugin_GetMetadata_FullMethodName = "/plugin.DSPlugin/GetMetadata" DSPlugin_Execute_FullMethodName = "/plugin.DSPlugin/Execute" DSPlugin_ValidateConfig_FullMethodName = "/plugin.DSPlugin/ValidateConfig" DSPlugin_GetSchema_FullMethodName = "/plugin.DSPlugin/GetSchema" )
Variables ¶
var DSPlugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "plugin.DSPlugin", HandlerType: (*DSPluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMetadata", Handler: _DSPlugin_GetMetadata_Handler, }, { MethodName: "Execute", Handler: _DSPlugin_Execute_Handler, }, { MethodName: "ValidateConfig", Handler: _DSPlugin_ValidateConfig_Handler, }, { MethodName: "GetSchema", Handler: _DSPlugin_GetSchema_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugin.proto", }
DSPlugin_ServiceDesc is the grpc.ServiceDesc for DSPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_plugin_proto protoreflect.FileDescriptor
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "DS_PLUGIN_MAGIC_COOKIE",
MagicCookieValue: "delivery-station-plugin",
}
Handshake is a common handshake config for all plugins
var PluginMap = map[string]plugin.Plugin{ "ds-plugin": &DSPlugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
func RegisterDSPluginServer ¶
func RegisterDSPluginServer(s grpc.ServiceRegistrar, srv DSPluginServer)
Types ¶
type DSPlugin ¶
type DSPlugin struct {
plugin.Plugin
// Impl is the interface implementation
Impl types.PluginProtocol
}
DSPlugin is the implementation of plugin.Plugin so we can serve/consume this
func (*DSPlugin) GRPCClient ¶
func (p *DSPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*DSPlugin) GRPCServer ¶
type DSPluginClient ¶
type DSPluginClient interface {
GetMetadata(ctx context.Context, in *GetMetadataRequest, opts ...grpc.CallOption) (*GetMetadataResponse, error)
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error)
GetSchema(ctx context.Context, in *GetSchemaRequest, opts ...grpc.CallOption) (*GetSchemaResponse, error)
}
DSPluginClient is the client API for DSPlugin 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.
DSPlugin service definition
func NewDSPluginClient ¶
func NewDSPluginClient(cc grpc.ClientConnInterface) DSPluginClient
type DSPluginServer ¶
type DSPluginServer interface {
GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error)
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
GetSchema(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error)
// contains filtered or unexported methods
}
DSPluginServer is the server API for DSPlugin service. All implementations must embed UnimplementedDSPluginServer for forward compatibility.
DSPlugin service definition
type ExecuteRequest ¶
type ExecuteRequest struct {
Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
Env map[string]string `` /* 133-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) GetArgs ¶
func (x *ExecuteRequest) GetArgs() []string
func (*ExecuteRequest) GetEnv ¶
func (x *ExecuteRequest) GetEnv() map[string]string
func (*ExecuteRequest) GetOperation ¶
func (x *ExecuteRequest) GetOperation() 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 {
Stdout string `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
Stderr string `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*ExecuteResponse) Descriptor
deprecated
func (*ExecuteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.
func (*ExecuteResponse) GetError ¶
func (x *ExecuteResponse) GetError() string
func (*ExecuteResponse) GetExitCode ¶
func (x *ExecuteResponse) GetExitCode() int32
func (*ExecuteResponse) GetStderr ¶
func (x *ExecuteResponse) GetStderr() string
func (*ExecuteResponse) GetStdout ¶
func (x *ExecuteResponse) GetStdout() string
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 GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is an implementation of PluginProtocol that talks over RPC
func (*GRPCClient) Execute ¶
func (m *GRPCClient) Execute(ctx context.Context, operation string, args []string, env map[string]string) (*types.ExecutionResult, error)
func (*GRPCClient) GetMetadata ¶
func (m *GRPCClient) GetMetadata(ctx context.Context) (*types.PluginMetadata, error)
func (*GRPCClient) GetSchema ¶
func (m *GRPCClient) GetSchema(ctx context.Context) (*types.PluginSchema, error)
func (*GRPCClient) ValidateConfig ¶
func (m *GRPCClient) ValidateConfig(ctx context.Context, config map[string]interface{}) error
type GRPCServer ¶
type GRPCServer struct {
UnimplementedDSPluginServer
Impl types.PluginProtocol
}
GRPCServer is the gRPC server that GRPCClient talks to
func (*GRPCServer) Execute ¶
func (m *GRPCServer) Execute(ctx context.Context, req *ExecuteRequest) (*ExecuteResponse, error)
func (*GRPCServer) GetMetadata ¶
func (m *GRPCServer) GetMetadata(ctx context.Context, req *GetMetadataRequest) (*GetMetadataResponse, error)
func (*GRPCServer) GetSchema ¶
func (m *GRPCServer) GetSchema(ctx context.Context, req *GetSchemaRequest) (*GetSchemaResponse, error)
func (*GRPCServer) ValidateConfig ¶
func (m *GRPCServer) ValidateConfig(ctx context.Context, req *ValidateConfigRequest) (*ValidateConfigResponse, error)
type GetMetadataRequest ¶
type GetMetadataRequest struct {
// contains filtered or unexported fields
}
func (*GetMetadataRequest) Descriptor
deprecated
func (*GetMetadataRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMetadataRequest.ProtoReflect.Descriptor instead.
func (*GetMetadataRequest) ProtoMessage ¶
func (*GetMetadataRequest) ProtoMessage()
func (*GetMetadataRequest) ProtoReflect ¶
func (x *GetMetadataRequest) ProtoReflect() protoreflect.Message
func (*GetMetadataRequest) Reset ¶
func (x *GetMetadataRequest) Reset()
func (*GetMetadataRequest) String ¶
func (x *GetMetadataRequest) String() string
type GetMetadataResponse ¶
type GetMetadataResponse struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Operations []string `protobuf:"bytes,4,rep,name=operations,proto3" json:"operations,omitempty"`
Platform *Platform `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
Config map[string]string `` /* 139-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetMetadataResponse) Descriptor
deprecated
func (*GetMetadataResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetMetadataResponse.ProtoReflect.Descriptor instead.
func (*GetMetadataResponse) GetConfig ¶
func (x *GetMetadataResponse) GetConfig() map[string]string
func (*GetMetadataResponse) GetDescription ¶
func (x *GetMetadataResponse) GetDescription() string
func (*GetMetadataResponse) GetName ¶
func (x *GetMetadataResponse) GetName() string
func (*GetMetadataResponse) GetOperations ¶
func (x *GetMetadataResponse) GetOperations() []string
func (*GetMetadataResponse) GetPlatform ¶
func (x *GetMetadataResponse) GetPlatform() *Platform
func (*GetMetadataResponse) GetVersion ¶
func (x *GetMetadataResponse) GetVersion() string
func (*GetMetadataResponse) ProtoMessage ¶
func (*GetMetadataResponse) ProtoMessage()
func (*GetMetadataResponse) ProtoReflect ¶
func (x *GetMetadataResponse) ProtoReflect() protoreflect.Message
func (*GetMetadataResponse) Reset ¶
func (x *GetMetadataResponse) Reset()
func (*GetMetadataResponse) String ¶
func (x *GetMetadataResponse) String() string
type GetSchemaRequest ¶
type GetSchemaRequest struct {
// contains filtered or unexported fields
}
func (*GetSchemaRequest) Descriptor
deprecated
func (*GetSchemaRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSchemaRequest.ProtoReflect.Descriptor instead.
func (*GetSchemaRequest) ProtoMessage ¶
func (*GetSchemaRequest) ProtoMessage()
func (*GetSchemaRequest) ProtoReflect ¶
func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message
func (*GetSchemaRequest) Reset ¶
func (x *GetSchemaRequest) Reset()
func (*GetSchemaRequest) String ¶
func (x *GetSchemaRequest) String() string
type GetSchemaResponse ¶
type GetSchemaResponse struct {
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
Properties map[string]*SchemaProperty `` /* 147-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetSchemaResponse) Descriptor
deprecated
func (*GetSchemaResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSchemaResponse.ProtoReflect.Descriptor instead.
func (*GetSchemaResponse) GetProperties ¶
func (x *GetSchemaResponse) GetProperties() map[string]*SchemaProperty
func (*GetSchemaResponse) GetVersion ¶
func (x *GetSchemaResponse) GetVersion() string
func (*GetSchemaResponse) ProtoMessage ¶
func (*GetSchemaResponse) ProtoMessage()
func (*GetSchemaResponse) ProtoReflect ¶
func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message
func (*GetSchemaResponse) Reset ¶
func (x *GetSchemaResponse) Reset()
func (*GetSchemaResponse) String ¶
func (x *GetSchemaResponse) String() string
type Platform ¶
type Platform struct {
Os []string `protobuf:"bytes,1,rep,name=os,proto3" json:"os,omitempty"`
Arch []string `protobuf:"bytes,2,rep,name=arch,proto3" json:"arch,omitempty"`
// contains filtered or unexported fields
}
func (*Platform) Descriptor
deprecated
func (*Platform) ProtoMessage ¶
func (*Platform) ProtoMessage()
func (*Platform) ProtoReflect ¶
func (x *Platform) ProtoReflect() protoreflect.Message
type SchemaProperty ¶
type SchemaProperty struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"`
Default string `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"`
// contains filtered or unexported fields
}
func (*SchemaProperty) Descriptor
deprecated
func (*SchemaProperty) Descriptor() ([]byte, []int)
Deprecated: Use SchemaProperty.ProtoReflect.Descriptor instead.
func (*SchemaProperty) GetDefault ¶
func (x *SchemaProperty) GetDefault() string
func (*SchemaProperty) GetDescription ¶
func (x *SchemaProperty) GetDescription() string
func (*SchemaProperty) GetRequired ¶
func (x *SchemaProperty) GetRequired() bool
func (*SchemaProperty) GetType ¶
func (x *SchemaProperty) GetType() string
func (*SchemaProperty) ProtoMessage ¶
func (*SchemaProperty) ProtoMessage()
func (*SchemaProperty) ProtoReflect ¶
func (x *SchemaProperty) ProtoReflect() protoreflect.Message
func (*SchemaProperty) Reset ¶
func (x *SchemaProperty) Reset()
func (*SchemaProperty) String ¶
func (x *SchemaProperty) String() string
type UnimplementedDSPluginServer ¶
type UnimplementedDSPluginServer struct{}
UnimplementedDSPluginServer 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 (UnimplementedDSPluginServer) Execute ¶
func (UnimplementedDSPluginServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
func (UnimplementedDSPluginServer) GetMetadata ¶
func (UnimplementedDSPluginServer) GetMetadata(context.Context, *GetMetadataRequest) (*GetMetadataResponse, error)
func (UnimplementedDSPluginServer) GetSchema ¶
func (UnimplementedDSPluginServer) GetSchema(context.Context, *GetSchemaRequest) (*GetSchemaResponse, error)
func (UnimplementedDSPluginServer) ValidateConfig ¶
func (UnimplementedDSPluginServer) ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
type UnsafeDSPluginServer ¶
type UnsafeDSPluginServer interface {
// contains filtered or unexported methods
}
UnsafeDSPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DSPluginServer will result in compilation errors.
type ValidateConfigRequest ¶
type ValidateConfigRequest struct {
Config map[string]string `` /* 139-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*ValidateConfigRequest) Descriptor
deprecated
func (*ValidateConfigRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateConfigRequest.ProtoReflect.Descriptor instead.
func (*ValidateConfigRequest) GetConfig ¶
func (x *ValidateConfigRequest) GetConfig() map[string]string
func (*ValidateConfigRequest) ProtoMessage ¶
func (*ValidateConfigRequest) ProtoMessage()
func (*ValidateConfigRequest) ProtoReflect ¶
func (x *ValidateConfigRequest) ProtoReflect() protoreflect.Message
func (*ValidateConfigRequest) Reset ¶
func (x *ValidateConfigRequest) Reset()
func (*ValidateConfigRequest) String ¶
func (x *ValidateConfigRequest) String() string
type ValidateConfigResponse ¶
type ValidateConfigResponse struct {
Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*ValidateConfigResponse) Descriptor
deprecated
func (*ValidateConfigResponse) Descriptor() ([]byte, []int)
Deprecated: Use ValidateConfigResponse.ProtoReflect.Descriptor instead.
func (*ValidateConfigResponse) GetError ¶
func (x *ValidateConfigResponse) GetError() string
func (*ValidateConfigResponse) GetValid ¶
func (x *ValidateConfigResponse) GetValid() bool
func (*ValidateConfigResponse) ProtoMessage ¶
func (*ValidateConfigResponse) ProtoMessage()
func (*ValidateConfigResponse) ProtoReflect ¶
func (x *ValidateConfigResponse) ProtoReflect() protoreflect.Message
func (*ValidateConfigResponse) Reset ¶
func (x *ValidateConfigResponse) Reset()
func (*ValidateConfigResponse) String ¶
func (x *ValidateConfigResponse) String() string