rpc

package
v0.0.0-...-fdfd418 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterTaskServer

func RegisterTaskServer(s *grpc.Server, srv TaskServer)

Types

type TaskClient

type TaskClient interface {
	Run(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error)
}

TaskClient is the client API for Task service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTaskClient

func NewTaskClient(cc grpc.ClientConnInterface) TaskClient

type TaskRequest

type TaskRequest struct {
	Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`  // 命令
	Timeout int32  `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 任务执行超时时间
	Id      int64  `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"`           // 执行任务唯一ID
	// contains filtered or unexported fields
}

func (*TaskRequest) Descriptor deprecated

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

Deprecated: Use TaskRequest.ProtoReflect.Descriptor instead.

func (*TaskRequest) GetCommand

func (x *TaskRequest) GetCommand() string

func (*TaskRequest) GetId

func (x *TaskRequest) GetId() int64

func (*TaskRequest) GetTimeout

func (x *TaskRequest) GetTimeout() int32

func (*TaskRequest) ProtoMessage

func (*TaskRequest) ProtoMessage()

func (*TaskRequest) ProtoReflect

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

func (*TaskRequest) Reset

func (x *TaskRequest) Reset()

func (*TaskRequest) String

func (x *TaskRequest) String() string

type TaskResponse

type TaskResponse struct {
	Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` // 命令标准输出
	Error  string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`   // 命令错误
	// contains filtered or unexported fields
}

func (*TaskResponse) Descriptor deprecated

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

Deprecated: Use TaskResponse.ProtoReflect.Descriptor instead.

func (*TaskResponse) GetError

func (x *TaskResponse) GetError() string

func (*TaskResponse) GetOutput

func (x *TaskResponse) GetOutput() string

func (*TaskResponse) ProtoMessage

func (*TaskResponse) ProtoMessage()

func (*TaskResponse) ProtoReflect

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

func (*TaskResponse) Reset

func (x *TaskResponse) Reset()

func (*TaskResponse) String

func (x *TaskResponse) String() string

type TaskServer

type TaskServer interface {
	Run(context.Context, *TaskRequest) (*TaskResponse, error)
}

TaskServer is the server API for Task service.

type UnimplementedTaskServer

type UnimplementedTaskServer struct {
}

UnimplementedTaskServer can be embedded to have forward compatible implementations.

func (*UnimplementedTaskServer) Run

Jump to

Keyboard shortcuts

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