shared

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJobClient added in v0.0.2

func NewJobClient() (protobuf.JobClient, error)

func NewPluginClient added in v0.0.2

func NewPluginClient(jobServerAddress, taskPluginPath, taskPluginName string, logger *log.Logger) *plugin.Client

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, jobId int64, jobRequest []byte) (*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, jobId int64, jobRequest []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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL