crocodile_task

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHeartbeatServer

func RegisterHeartbeatServer(s *grpc.Server, srv HeartbeatServer)

func RegisterTaskServer

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

Types

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type HeartbeatClient

type HeartbeatClient interface {
	// registry host
	RegistryHost(ctx context.Context, in *RegistryReq, opts ...grpc.CallOption) (*Empty, error)
	// SendHb send to server req to itself alive
	SendHb(ctx context.Context, in *HeartbeatReq, opts ...grpc.CallOption) (*Empty, error)
}

HeartbeatClient is the client API for Heartbeat service.

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

func NewHeartbeatClient

func NewHeartbeatClient(cc *grpc.ClientConn) HeartbeatClient

type HeartbeatReq

type HeartbeatReq struct {
	// string ip = 1;
	Port                 int32    `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	RunningTask          []string `protobuf:"bytes,3,rep,name=running_task,json=runningTask,proto3" json:"running_task,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HeartbeatReq) Descriptor

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

func (*HeartbeatReq) GetPort

func (m *HeartbeatReq) GetPort() int32

func (*HeartbeatReq) GetRunningTask

func (m *HeartbeatReq) GetRunningTask() []string

func (*HeartbeatReq) ProtoMessage

func (*HeartbeatReq) ProtoMessage()

func (*HeartbeatReq) Reset

func (m *HeartbeatReq) Reset()

func (*HeartbeatReq) String

func (m *HeartbeatReq) String() string

func (*HeartbeatReq) XXX_DiscardUnknown

func (m *HeartbeatReq) XXX_DiscardUnknown()

func (*HeartbeatReq) XXX_Marshal

func (m *HeartbeatReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeartbeatReq) XXX_Merge

func (m *HeartbeatReq) XXX_Merge(src proto.Message)

func (*HeartbeatReq) XXX_Size

func (m *HeartbeatReq) XXX_Size() int

func (*HeartbeatReq) XXX_Unmarshal

func (m *HeartbeatReq) XXX_Unmarshal(b []byte) error

type HeartbeatServer

type HeartbeatServer interface {
	// registry host
	RegistryHost(context.Context, *RegistryReq) (*Empty, error)
	// SendHb send to server req to itself alive
	SendHb(context.Context, *HeartbeatReq) (*Empty, error)
}

HeartbeatServer is the server API for Heartbeat service.

type RegistryReq

type RegistryReq struct {
	Ip                   string   `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	Port                 int32    `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	Weight               int32    `protobuf:"varint,3,opt,name=weight,proto3" json:"weight,omitempty"`
	Hostname             string   `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Version              string   `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
	Hostgroup            string   `protobuf:"bytes,6,opt,name=hostgroup,proto3" json:"hostgroup,omitempty"`
	Remark               string   `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegistryReq) Descriptor

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

func (*RegistryReq) GetHostgroup

func (m *RegistryReq) GetHostgroup() string

func (*RegistryReq) GetHostname

func (m *RegistryReq) GetHostname() string

func (*RegistryReq) GetIp

func (m *RegistryReq) GetIp() string

func (*RegistryReq) GetPort

func (m *RegistryReq) GetPort() int32

func (*RegistryReq) GetRemark

func (m *RegistryReq) GetRemark() string

func (*RegistryReq) GetVersion

func (m *RegistryReq) GetVersion() string

func (*RegistryReq) GetWeight

func (m *RegistryReq) GetWeight() int32

func (*RegistryReq) ProtoMessage

func (*RegistryReq) ProtoMessage()

func (*RegistryReq) Reset

func (m *RegistryReq) Reset()

func (*RegistryReq) String

func (m *RegistryReq) String() string

func (*RegistryReq) XXX_DiscardUnknown

func (m *RegistryReq) XXX_DiscardUnknown()

func (*RegistryReq) XXX_Marshal

func (m *RegistryReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegistryReq) XXX_Merge

func (m *RegistryReq) XXX_Merge(src proto.Message)

func (*RegistryReq) XXX_Size

func (m *RegistryReq) XXX_Size() int

func (*RegistryReq) XXX_Unmarshal

func (m *RegistryReq) XXX_Unmarshal(b []byte) error

type TaskClient

type TaskClient interface {
	// run task return stream bytes
	RunTask(ctx context.Context, in *TaskReq, opts ...grpc.CallOption) (Task_RunTaskClient, 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.ClientConn) TaskClient

type TaskReq

type TaskReq struct {
	TaskId               string   `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	TaskType             int32    `protobuf:"varint,2,opt,name=task_type,json=taskType,proto3" json:"task_type,omitempty"`
	TaskData             []byte   `protobuf:"bytes,3,opt,name=task_data,json=taskData,proto3" json:"task_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

task req

func (*TaskReq) Descriptor

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

func (*TaskReq) GetTaskData

func (m *TaskReq) GetTaskData() []byte

func (*TaskReq) GetTaskId

func (m *TaskReq) GetTaskId() string

func (*TaskReq) GetTaskType

func (m *TaskReq) GetTaskType() int32

func (*TaskReq) ProtoMessage

func (*TaskReq) ProtoMessage()

func (*TaskReq) Reset

func (m *TaskReq) Reset()

func (*TaskReq) String

func (m *TaskReq) String() string

func (*TaskReq) XXX_DiscardUnknown

func (m *TaskReq) XXX_DiscardUnknown()

func (*TaskReq) XXX_Marshal

func (m *TaskReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TaskReq) XXX_Merge

func (m *TaskReq) XXX_Merge(src proto.Message)

func (*TaskReq) XXX_Size

func (m *TaskReq) XXX_Size() int

func (*TaskReq) XXX_Unmarshal

func (m *TaskReq) XXX_Unmarshal(b []byte) error

type TaskResp

type TaskResp struct {
	Resp                 []byte   `protobuf:"bytes,3,opt,name=resp,proto3" json:"resp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

task reso stream

func (*TaskResp) Descriptor

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

func (*TaskResp) GetResp

func (m *TaskResp) GetResp() []byte

func (*TaskResp) ProtoMessage

func (*TaskResp) ProtoMessage()

func (*TaskResp) Reset

func (m *TaskResp) Reset()

func (*TaskResp) String

func (m *TaskResp) String() string

func (*TaskResp) XXX_DiscardUnknown

func (m *TaskResp) XXX_DiscardUnknown()

func (*TaskResp) XXX_Marshal

func (m *TaskResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TaskResp) XXX_Merge

func (m *TaskResp) XXX_Merge(src proto.Message)

func (*TaskResp) XXX_Size

func (m *TaskResp) XXX_Size() int

func (*TaskResp) XXX_Unmarshal

func (m *TaskResp) XXX_Unmarshal(b []byte) error

type TaskRespOld

type TaskRespOld struct {
	Code                 int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	ErrMsg               []byte   `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
	RespData             []byte   `protobuf:"bytes,3,opt,name=resp_data,json=respData,proto3" json:"resp_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TaskRespOld) Descriptor

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

func (*TaskRespOld) GetCode

func (m *TaskRespOld) GetCode() int32

func (*TaskRespOld) GetErrMsg

func (m *TaskRespOld) GetErrMsg() []byte

func (*TaskRespOld) GetRespData

func (m *TaskRespOld) GetRespData() []byte

func (*TaskRespOld) ProtoMessage

func (*TaskRespOld) ProtoMessage()

func (*TaskRespOld) Reset

func (m *TaskRespOld) Reset()

func (*TaskRespOld) String

func (m *TaskRespOld) String() string

func (*TaskRespOld) XXX_DiscardUnknown

func (m *TaskRespOld) XXX_DiscardUnknown()

func (*TaskRespOld) XXX_Marshal

func (m *TaskRespOld) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TaskRespOld) XXX_Merge

func (m *TaskRespOld) XXX_Merge(src proto.Message)

func (*TaskRespOld) XXX_Size

func (m *TaskRespOld) XXX_Size() int

func (*TaskRespOld) XXX_Unmarshal

func (m *TaskRespOld) XXX_Unmarshal(b []byte) error

type TaskServer

type TaskServer interface {
	// run task return stream bytes
	RunTask(*TaskReq, Task_RunTaskServer) error
}

TaskServer is the server API for Task service.

type Task_RunTaskClient

type Task_RunTaskClient interface {
	Recv() (*TaskResp, error)
	grpc.ClientStream
}

type Task_RunTaskServer

type Task_RunTaskServer interface {
	Send(*TaskResp) error
	grpc.ServerStream
}

type UnimplementedHeartbeatServer

type UnimplementedHeartbeatServer struct {
}

UnimplementedHeartbeatServer can be embedded to have forward compatible implementations.

func (*UnimplementedHeartbeatServer) RegistryHost

func (*UnimplementedHeartbeatServer) RegistryHost(ctx context.Context, req *RegistryReq) (*Empty, error)

func (*UnimplementedHeartbeatServer) SendHb

type UnimplementedTaskServer

type UnimplementedTaskServer struct {
}

UnimplementedTaskServer can be embedded to have forward compatible implementations.

func (*UnimplementedTaskServer) RunTask

Jump to

Keyboard shortcuts

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