Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJobClient ¶ added in v0.0.2
func NewPluginClient ¶ added in v0.0.2
func PluginServe ¶ added in v0.0.2
func PluginServe(taskName string, taskServer protobuf.TaskServer)
Types ¶
type Job ¶
type Job interface {
InvokeService(request *protobuf.JobInvokeServiceRequest) (*protobuf.JobInvokeServiceResponse, error)
}
type Task ¶
type Task interface {
Execute(ctx context.Context, request *protobuf.ExecuteTaskRequest) (*protobuf.ExecuteTaskResponse, error) // 执行任务
GetDescription() (string, error) // 获取任务描述
}
type TaskClient ¶
type TaskClient struct {
// contains filtered or unexported fields
}
TaskClient 实现Task接口的客户端适配器
func (*TaskClient) Execute ¶
func (c *TaskClient) Execute(ctx context.Context, request []byte) (*protobuf.ExecuteTaskResponse, error)
func (*TaskClient) GetDescription ¶ added in v0.0.3
func (c *TaskClient) GetDescription() (string, error)
type TaskPlugin ¶
type TaskPlugin struct {
plugin.NetRPCUnsupportedPlugin
Impl protobuf.TaskServer
}
func (TaskPlugin) GRPCClient ¶
func (t TaskPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)
func (TaskPlugin) GRPCServer ¶
func (t TaskPlugin) GRPCServer(broker *plugin.GRPCBroker, server *grpc.Server) error
Click to show internal directories.
Click to hide internal directories.