Documentation ¶
Index ¶
- Variables
- func RegisterTaskServer(s *grpc.Server, srv TaskServer)
- type TaskClient
- type TaskRequest
- func (*TaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TaskRequest) GetCommand() string
- func (x *TaskRequest) GetId() int64
- func (x *TaskRequest) GetTimeout() int32
- func (*TaskRequest) ProtoMessage()
- func (x *TaskRequest) ProtoReflect() protoreflect.Message
- func (x *TaskRequest) Reset()
- func (x *TaskRequest) String() string
- type TaskResponse
- func (*TaskResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TaskResponse) GetError() string
- func (x *TaskResponse) GetOutput() string
- func (*TaskResponse) ProtoMessage()
- func (x *TaskResponse) ProtoReflect() protoreflect.Message
- func (x *TaskResponse) Reset()
- func (x *TaskResponse) String() string
- type TaskServer
- type UnimplementedTaskServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_task_proto protoreflect.FileDescriptor
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 ¶
func (*UnimplementedTaskServer) Run(context.Context, *TaskRequest) (*TaskResponse, error)
Click to show internal directories.
Click to hide internal directories.