task

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskService_SubscribeTask_FullMethodName = "/task.TaskService/SubscribeTask"
)

Variables

View Source
var File_api_proto_task_proto protoreflect.FileDescriptor
View Source
var TaskService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "task.TaskService",
	HandlerType: (*TaskServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeTask",
			Handler:       _TaskService_SubscribeTask_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/proto/task.proto",
}

TaskService_ServiceDesc is the grpc.ServiceDesc for TaskService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServer

func RegisterServer(s grpc.ServiceRegistrar, taskConf string) error

RegisterServer register the monitor server

func RegisterTaskServiceServer

func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer)

Types

type ClientInfo

type ClientInfo struct {

	// ClientId the client id
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// Labels the client labels that are used to match tasks
	Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

ClientInfo the task client info

func (*ClientInfo) Descriptor deprecated

func (*ClientInfo) Descriptor() ([]byte, []int)

Deprecated: Use ClientInfo.ProtoReflect.Descriptor instead.

func (*ClientInfo) GetClientId

func (x *ClientInfo) GetClientId() string

func (*ClientInfo) GetLabels

func (x *ClientInfo) GetLabels() []string

func (*ClientInfo) ProtoMessage

func (*ClientInfo) ProtoMessage()

func (*ClientInfo) ProtoReflect

func (x *ClientInfo) ProtoReflect() protoreflect.Message

func (*ClientInfo) Reset

func (x *ClientInfo) Reset()

func (*ClientInfo) String

func (x *ClientInfo) String() string

type Dispatcher

type Dispatcher interface {
	// Acquire try to acquire a task
	Acquire(client *ClientInfo, ip string) (task *TaskInfo, err error)
}

Dispatcher the task dispatcher interface

type TaskInfo

type TaskInfo struct {

	// Name the unique task name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Ext the extension type of the task config content
	Ext string `protobuf:"bytes,2,opt,name=ext,proto3" json:"ext,omitempty"`
	// Content the task config content
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

TaskInfo the task info

func (*TaskInfo) Descriptor deprecated

func (*TaskInfo) Descriptor() ([]byte, []int)

Deprecated: Use TaskInfo.ProtoReflect.Descriptor instead.

func (*TaskInfo) GetContent

func (x *TaskInfo) GetContent() string

func (*TaskInfo) GetExt

func (x *TaskInfo) GetExt() string

func (*TaskInfo) GetName

func (x *TaskInfo) GetName() string

func (*TaskInfo) ProtoMessage

func (*TaskInfo) ProtoMessage()

func (*TaskInfo) ProtoReflect

func (x *TaskInfo) ProtoReflect() protoreflect.Message

func (*TaskInfo) Reset

func (x *TaskInfo) Reset()

func (*TaskInfo) String

func (x *TaskInfo) String() string

type TaskServiceClient

type TaskServiceClient interface {
	// SubscribeTask register a task client to the task server and wait to receive task
	SubscribeTask(ctx context.Context, in *ClientInfo, opts ...grpc.CallOption) (TaskService_SubscribeTaskClient, error)
}

TaskServiceClient is the client API for TaskService 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.

type TaskServiceServer

type TaskServiceServer interface {
	// SubscribeTask register a task client to the task server and wait to receive task
	SubscribeTask(*ClientInfo, TaskService_SubscribeTaskServer) error
	// contains filtered or unexported methods
}

TaskServiceServer is the server API for TaskService service. All implementations must embed UnimplementedTaskServiceServer for forward compatibility

type TaskService_SubscribeTaskClient

type TaskService_SubscribeTaskClient interface {
	Recv() (*TaskInfo, error)
	grpc.ClientStream
}

type TaskService_SubscribeTaskServer

type TaskService_SubscribeTaskServer interface {
	Send(*TaskInfo) error
	grpc.ServerStream
}

type UnimplementedTaskServiceServer

type UnimplementedTaskServiceServer struct {
}

UnimplementedTaskServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTaskServiceServer) SubscribeTask

type UnsafeTaskServiceServer

type UnsafeTaskServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTaskServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TaskServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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