rpc

package
v0.0.0-...-000f062 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_dbtask_proto protoreflect.FileDescriptor

Functions

func RegisterTaskServer

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

Types

type DbTaskRequest

type DbTaskRequest struct {
	Local   string               `protobuf:"bytes,1,opt,name=local,proto3" json:"local,omitempty"`
	Dbname  string               `protobuf:"bytes,2,opt,name=dbname,proto3" json:"dbname,omitempty"`
	Port    int64                `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	Dip     string               `protobuf:"bytes,4,opt,name=dip,proto3" json:"dip,omitempty"` // 命令
	Ac      string               `protobuf:"bytes,5,opt,name=ac,proto3" json:"ac,omitempty"`
	Pd      string               `protobuf:"bytes,6,opt,name=pd,proto3" json:"pd,omitempty"`
	Dtype   int32                `protobuf:"varint,7,opt,name=dtype,proto3" json:"dtype,omitempty"`
	Sqlpath string               `protobuf:"bytes,8,opt,name=sqlpath,proto3" json:"sqlpath,omitempty"`
	Timeout int32                `protobuf:"varint,9,opt,name=timeout,proto3" json:"timeout,omitempty"` // 任务执行超时时间
	Id      int64                `protobuf:"varint,10,opt,name=id,proto3" json:"id,omitempty"`          // 执行任务唯一ID
	Ftp     []*DbTaskRequest_Ftp `protobuf:"bytes,11,rep,name=ftp,proto3" json:"ftp,omitempty"`
	// contains filtered or unexported fields
}

func (*DbTaskRequest) Descriptor deprecated

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

Deprecated: Use DbTaskRequest.ProtoReflect.Descriptor instead.

func (*DbTaskRequest) GetAc

func (x *DbTaskRequest) GetAc() string

func (*DbTaskRequest) GetDbname

func (x *DbTaskRequest) GetDbname() string

func (*DbTaskRequest) GetDip

func (x *DbTaskRequest) GetDip() string

func (*DbTaskRequest) GetDtype

func (x *DbTaskRequest) GetDtype() int32

func (*DbTaskRequest) GetFtp

func (x *DbTaskRequest) GetFtp() []*DbTaskRequest_Ftp

func (*DbTaskRequest) GetId

func (x *DbTaskRequest) GetId() int64

func (*DbTaskRequest) GetLocal

func (x *DbTaskRequest) GetLocal() string

func (*DbTaskRequest) GetPd

func (x *DbTaskRequest) GetPd() string

func (*DbTaskRequest) GetPort

func (x *DbTaskRequest) GetPort() int64

func (*DbTaskRequest) GetSqlpath

func (x *DbTaskRequest) GetSqlpath() string

func (*DbTaskRequest) GetTimeout

func (x *DbTaskRequest) GetTimeout() int32

func (*DbTaskRequest) ProtoMessage

func (*DbTaskRequest) ProtoMessage()

func (*DbTaskRequest) ProtoReflect

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

func (*DbTaskRequest) Reset

func (x *DbTaskRequest) Reset()

func (*DbTaskRequest) String

func (x *DbTaskRequest) String() string

type DbTaskRequest_Ftp

type DbTaskRequest_Ftp struct {
	Dip  string `protobuf:"bytes,1,opt,name=dip,proto3" json:"dip,omitempty"` // 命令
	Port int64  `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	Ac   string `protobuf:"bytes,3,opt,name=ac,proto3" json:"ac,omitempty"`
	Pd   string `protobuf:"bytes,4,opt,name=pd,proto3" json:"pd,omitempty"`
	// contains filtered or unexported fields
}

func (*DbTaskRequest_Ftp) Descriptor deprecated

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

Deprecated: Use DbTaskRequest_Ftp.ProtoReflect.Descriptor instead.

func (*DbTaskRequest_Ftp) GetAc

func (x *DbTaskRequest_Ftp) GetAc() string

func (*DbTaskRequest_Ftp) GetDip

func (x *DbTaskRequest_Ftp) GetDip() string

func (*DbTaskRequest_Ftp) GetPd

func (x *DbTaskRequest_Ftp) GetPd() string

func (*DbTaskRequest_Ftp) GetPort

func (x *DbTaskRequest_Ftp) GetPort() int64

func (*DbTaskRequest_Ftp) ProtoMessage

func (*DbTaskRequest_Ftp) ProtoMessage()

func (*DbTaskRequest_Ftp) ProtoReflect

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

func (*DbTaskRequest_Ftp) Reset

func (x *DbTaskRequest_Ftp) Reset()

func (*DbTaskRequest_Ftp) String

func (x *DbTaskRequest_Ftp) String() string

type DbTaskResponse

type DbTaskResponse 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 (*DbTaskResponse) Descriptor deprecated

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

Deprecated: Use DbTaskResponse.ProtoReflect.Descriptor instead.

func (*DbTaskResponse) GetError

func (x *DbTaskResponse) GetError() string

func (*DbTaskResponse) GetOutput

func (x *DbTaskResponse) GetOutput() string

func (*DbTaskResponse) ProtoMessage

func (*DbTaskResponse) ProtoMessage()

func (*DbTaskResponse) ProtoReflect

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

func (*DbTaskResponse) Reset

func (x *DbTaskResponse) Reset()

func (*DbTaskResponse) String

func (x *DbTaskResponse) String() string

type SomeOtherRequest

type SomeOtherRequest struct {
	Requst *DbTaskRequest `protobuf:"bytes,1,opt,name=requst,proto3" json:"requst,omitempty"`
	// contains filtered or unexported fields
}

func (*SomeOtherRequest) Descriptor deprecated

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

Deprecated: Use SomeOtherRequest.ProtoReflect.Descriptor instead.

func (*SomeOtherRequest) GetRequst

func (x *SomeOtherRequest) GetRequst() *DbTaskRequest

func (*SomeOtherRequest) ProtoMessage

func (*SomeOtherRequest) ProtoMessage()

func (*SomeOtherRequest) ProtoReflect

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

func (*SomeOtherRequest) Reset

func (x *SomeOtherRequest) Reset()

func (*SomeOtherRequest) String

func (x *SomeOtherRequest) String() string

type TaskClient

type TaskClient interface {
	Run(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error)
	DbRun(ctx context.Context, in *DbTaskRequest, opts ...grpc.CallOption) (*DbTaskResponse, 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)
	DbRun(context.Context, *DbTaskRequest) (*DbTaskResponse, 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) DbRun

func (*UnimplementedTaskServer) Run

Jump to

Keyboard shortcuts

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