grpc

package module
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: BSD-3-Clause Imports: 9 Imported by: 44

README

crawlab-grpc

gRPC for Crawlab

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResponseCode_name = map[int32]string{
		0: "OK",
		1: "ERROR",
	}
	ResponseCode_value = map[string]int32{
		"OK":    0,
		"ERROR": 1,
	}
)

Enum value maps for ResponseCode.

View Source
var (
	StreamMessageCode_name = map[int32]string{
		0:  "PING",
		1:  "RUN_TASK",
		2:  "CANCEL_TASK",
		3:  "INSERT_DATA",
		4:  "INSERT_LOGS",
		5:  "SEND_EVENT",
		6:  "INSTALL_PLUGIN",
		7:  "UNINSTALL_PLUGIN",
		8:  "START_PLUGIN",
		9:  "STOP_PLUGIN",
		10: "CONNECT",
		11: "DISCONNECT",
		12: "SEND",
	}
	StreamMessageCode_value = map[string]int32{
		"PING":             0,
		"RUN_TASK":         1,
		"CANCEL_TASK":      2,
		"INSERT_DATA":      3,
		"INSERT_LOGS":      4,
		"SEND_EVENT":       5,
		"INSTALL_PLUGIN":   6,
		"UNINSTALL_PLUGIN": 7,
		"START_PLUGIN":     8,
		"STOP_PLUGIN":      9,
		"CONNECT":          10,
		"DISCONNECT":       11,
		"SEND":             12,
	}
)

Enum value maps for StreamMessageCode.

View Source
var File_entity_node_info_proto protoreflect.FileDescriptor
View Source
var File_entity_plugin_request_proto protoreflect.FileDescriptor
View Source
var File_entity_request_proto protoreflect.FileDescriptor
View Source
var File_entity_response_code_proto protoreflect.FileDescriptor
View Source
var File_entity_response_proto protoreflect.FileDescriptor
View Source
var File_entity_stream_message_code_proto protoreflect.FileDescriptor
View Source
var File_entity_stream_message_data_task_proto protoreflect.FileDescriptor
View Source
var File_entity_stream_message_proto protoreflect.FileDescriptor
View Source
var File_models_node_proto protoreflect.FileDescriptor
View Source
var File_models_task_proto protoreflect.FileDescriptor
View Source
var File_services_message_service_proto protoreflect.FileDescriptor
View Source
var File_services_model_base_service_proto protoreflect.FileDescriptor
View Source
var File_services_model_base_service_v2_proto protoreflect.FileDescriptor
View Source
var File_services_model_delegate_proto protoreflect.FileDescriptor
View Source
var File_services_node_service_proto protoreflect.FileDescriptor
View Source
var File_services_plugin_service_proto protoreflect.FileDescriptor
View Source
var File_services_task_service_proto protoreflect.FileDescriptor
View Source
var MessageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.MessageService",
	HandlerType: (*MessageServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _MessageService_Connect_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "services/message_service.proto",
}

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

View Source
var ModelBaseServiceV2_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.ModelBaseServiceV2",
	HandlerType: (*ModelBaseServiceV2Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetById",
			Handler:    _ModelBaseServiceV2_GetById_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ModelBaseServiceV2_Get_Handler,
		},
		{
			MethodName: "GetList",
			Handler:    _ModelBaseServiceV2_GetList_Handler,
		},
		{
			MethodName: "DeleteById",
			Handler:    _ModelBaseServiceV2_DeleteById_Handler,
		},
		{
			MethodName: "DeleteList",
			Handler:    _ModelBaseServiceV2_DeleteList_Handler,
		},
		{
			MethodName: "UpdateById",
			Handler:    _ModelBaseServiceV2_UpdateById_Handler,
		},
		{
			MethodName: "UpdateOne",
			Handler:    _ModelBaseServiceV2_UpdateOne_Handler,
		},
		{
			MethodName: "UpdateMany",
			Handler:    _ModelBaseServiceV2_UpdateMany_Handler,
		},
		{
			MethodName: "ReplaceById",
			Handler:    _ModelBaseServiceV2_ReplaceById_Handler,
		},
		{
			MethodName: "Replace",
			Handler:    _ModelBaseServiceV2_Replace_Handler,
		},
		{
			MethodName: "InsertOne",
			Handler:    _ModelBaseServiceV2_InsertOne_Handler,
		},
		{
			MethodName: "InsertMany",
			Handler:    _ModelBaseServiceV2_InsertMany_Handler,
		},
		{
			MethodName: "Count",
			Handler:    _ModelBaseServiceV2_Count_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/model_base_service_v2.proto",
}

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

View Source
var ModelBaseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.ModelBaseService",
	HandlerType: (*ModelBaseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetById",
			Handler:    _ModelBaseService_GetById_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ModelBaseService_Get_Handler,
		},
		{
			MethodName: "GetList",
			Handler:    _ModelBaseService_GetList_Handler,
		},
		{
			MethodName: "DeleteById",
			Handler:    _ModelBaseService_DeleteById_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ModelBaseService_Delete_Handler,
		},
		{
			MethodName: "DeleteList",
			Handler:    _ModelBaseService_DeleteList_Handler,
		},
		{
			MethodName: "ForceDeleteList",
			Handler:    _ModelBaseService_ForceDeleteList_Handler,
		},
		{
			MethodName: "UpdateById",
			Handler:    _ModelBaseService_UpdateById_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ModelBaseService_Update_Handler,
		},
		{
			MethodName: "UpdateDoc",
			Handler:    _ModelBaseService_UpdateDoc_Handler,
		},
		{
			MethodName: "Insert",
			Handler:    _ModelBaseService_Insert_Handler,
		},
		{
			MethodName: "Count",
			Handler:    _ModelBaseService_Count_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/model_base_service.proto",
}

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

View Source
var ModelDelegate_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.ModelDelegate",
	HandlerType: (*ModelDelegateServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Do",
			Handler:    _ModelDelegate_Do_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/model_delegate.proto",
}

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

View Source
var NodeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.NodeService",
	HandlerType: (*NodeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _NodeService_Register_Handler,
		},
		{
			MethodName: "SendHeartbeat",
			Handler:    _NodeService_SendHeartbeat_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _NodeService_Ping_Handler,
		},
		{
			MethodName: "Unsubscribe",
			Handler:    _NodeService_Unsubscribe_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _NodeService_Subscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "services/node_service.proto",
}

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

View Source
var PluginService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.PluginService",
	HandlerType: (*PluginServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _PluginService_Register_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _PluginService_Subscribe_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Poll",
			Handler:       _PluginService_Poll_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "services/plugin_service.proto",
}

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

View Source
var TaskService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.TaskService",
	HandlerType: (*TaskServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _TaskService_Fetch_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _TaskService_Subscribe_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "services/task_service.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 RegisterMessageServiceServer added in v0.6.3

func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer)

func RegisterModelBaseServiceServer

func RegisterModelBaseServiceServer(s grpc.ServiceRegistrar, srv ModelBaseServiceServer)

func RegisterModelBaseServiceV2Server added in v0.6.3

func RegisterModelBaseServiceV2Server(s grpc.ServiceRegistrar, srv ModelBaseServiceV2Server)

func RegisterModelDelegateServer

func RegisterModelDelegateServer(s grpc.ServiceRegistrar, srv ModelDelegateServer)

func RegisterNodeServiceServer

func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)

func RegisterPluginServiceServer

func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)

func RegisterTaskServiceServer

func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer)

Types

type MessageServiceClient added in v0.6.3

type MessageServiceClient interface {
	Connect(ctx context.Context, opts ...grpc.CallOption) (MessageService_ConnectClient, error)
}

MessageServiceClient is the client API for MessageService 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.

func NewMessageServiceClient added in v0.6.3

func NewMessageServiceClient(cc grpc.ClientConnInterface) MessageServiceClient

type MessageServiceServer added in v0.6.3

type MessageServiceServer interface {
	Connect(MessageService_ConnectServer) error
	// contains filtered or unexported methods
}

MessageServiceServer is the server API for MessageService service. All implementations must embed UnimplementedMessageServiceServer for forward compatibility

type MessageService_ConnectClient added in v0.6.3

type MessageService_ConnectClient interface {
	Send(*StreamMessage) error
	Recv() (*StreamMessage, error)
	grpc.ClientStream
}

type MessageService_ConnectServer added in v0.6.3

type MessageService_ConnectServer interface {
	Send(*StreamMessage) error
	Recv() (*StreamMessage, error)
	grpc.ServerStream
}

type ModelBaseServiceClient

type ModelBaseServiceClient interface {
	GetById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Get(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	GetList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	DeleteById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Delete(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	DeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	ForceDeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdateById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Update(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdateDoc(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Insert(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Count(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

ModelBaseServiceClient is the client API for ModelBaseService 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 ModelBaseServiceServer

type ModelBaseServiceServer interface {
	GetById(context.Context, *Request) (*Response, error)
	Get(context.Context, *Request) (*Response, error)
	GetList(context.Context, *Request) (*Response, error)
	DeleteById(context.Context, *Request) (*Response, error)
	Delete(context.Context, *Request) (*Response, error)
	DeleteList(context.Context, *Request) (*Response, error)
	ForceDeleteList(context.Context, *Request) (*Response, error)
	UpdateById(context.Context, *Request) (*Response, error)
	Update(context.Context, *Request) (*Response, error)
	UpdateDoc(context.Context, *Request) (*Response, error)
	Insert(context.Context, *Request) (*Response, error)
	Count(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

ModelBaseServiceServer is the server API for ModelBaseService service. All implementations must embed UnimplementedModelBaseServiceServer for forward compatibility

type ModelBaseServiceV2Client added in v0.6.3

type ModelBaseServiceV2Client interface {
	GetById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Get(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	GetList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	DeleteById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	DeleteList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdateById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdateOne(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	UpdateMany(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	ReplaceById(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Replace(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	InsertOne(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	InsertMany(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Count(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

ModelBaseServiceV2Client is the client API for ModelBaseServiceV2 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.

func NewModelBaseServiceV2Client added in v0.6.3

func NewModelBaseServiceV2Client(cc grpc.ClientConnInterface) ModelBaseServiceV2Client

type ModelBaseServiceV2Server added in v0.6.3

type ModelBaseServiceV2Server interface {
	GetById(context.Context, *Request) (*Response, error)
	Get(context.Context, *Request) (*Response, error)
	GetList(context.Context, *Request) (*Response, error)
	DeleteById(context.Context, *Request) (*Response, error)
	DeleteList(context.Context, *Request) (*Response, error)
	UpdateById(context.Context, *Request) (*Response, error)
	UpdateOne(context.Context, *Request) (*Response, error)
	UpdateMany(context.Context, *Request) (*Response, error)
	ReplaceById(context.Context, *Request) (*Response, error)
	Replace(context.Context, *Request) (*Response, error)
	InsertOne(context.Context, *Request) (*Response, error)
	InsertMany(context.Context, *Request) (*Response, error)
	Count(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

ModelBaseServiceV2Server is the server API for ModelBaseServiceV2 service. All implementations must embed UnimplementedModelBaseServiceV2Server for forward compatibility

type ModelDelegateClient

type ModelDelegateClient interface {
	Do(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

ModelDelegateClient is the client API for ModelDelegate 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 ModelDelegateServer

type ModelDelegateServer interface {
	Do(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

ModelDelegateServer is the server API for ModelDelegate service. All implementations must embed UnimplementedModelDelegateServer for forward compatibility

type Node

type Node struct {
	XId          string `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
	Name         string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Ip           string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
	Port         string `protobuf:"bytes,5,opt,name=port,proto3" json:"port,omitempty"`
	Mac          string `protobuf:"bytes,6,opt,name=mac,proto3" json:"mac,omitempty"`
	Hostname     string `protobuf:"bytes,7,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Description  string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
	Key          string `protobuf:"bytes,9,opt,name=key,proto3" json:"key,omitempty"`
	IsMaster     bool   `protobuf:"varint,11,opt,name=is_master,json=isMaster,proto3" json:"is_master,omitempty"`
	UpdateTs     string `protobuf:"bytes,12,opt,name=update_ts,json=updateTs,proto3" json:"update_ts,omitempty"`
	CreateTs     string `protobuf:"bytes,13,opt,name=create_ts,json=createTs,proto3" json:"create_ts,omitempty"`
	UpdateTsUnix int64  `protobuf:"varint,14,opt,name=update_ts_unix,json=updateTsUnix,proto3" json:"update_ts_unix,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetCreateTs

func (x *Node) GetCreateTs() string

func (*Node) GetDescription

func (x *Node) GetDescription() string

func (*Node) GetHostname

func (x *Node) GetHostname() string

func (*Node) GetIp

func (x *Node) GetIp() string

func (*Node) GetIsMaster

func (x *Node) GetIsMaster() bool

func (*Node) GetKey

func (x *Node) GetKey() string

func (*Node) GetMac

func (x *Node) GetMac() string

func (*Node) GetName

func (x *Node) GetName() string

func (*Node) GetPort

func (x *Node) GetPort() string

func (*Node) GetUpdateTs

func (x *Node) GetUpdateTs() string

func (*Node) GetUpdateTsUnix

func (x *Node) GetUpdateTsUnix() int64

func (*Node) GetXId

func (x *Node) GetXId() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type NodeInfo

type NodeInfo struct {
	Key      string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	IsMaster bool   `protobuf:"varint,2,opt,name=is_master,json=isMaster,proto3" json:"is_master,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeInfo) Descriptor deprecated

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

Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead.

func (*NodeInfo) GetIsMaster

func (x *NodeInfo) GetIsMaster() bool

func (*NodeInfo) GetKey

func (x *NodeInfo) GetKey() string

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) ProtoReflect

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

func (*NodeInfo) Reset

func (x *NodeInfo) Reset()

func (*NodeInfo) String

func (x *NodeInfo) String() string

type NodeServiceClient

type NodeServiceClient interface {
	Register(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	SendHeartbeat(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Subscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (NodeService_SubscribeClient, error)
	Unsubscribe(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

NodeServiceClient is the client API for NodeService 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 NodeServiceServer

type NodeServiceServer interface {
	Register(context.Context, *Request) (*Response, error)
	SendHeartbeat(context.Context, *Request) (*Response, error)
	Ping(context.Context, *Request) (*Response, error)
	Subscribe(*Request, NodeService_SubscribeServer) error
	Unsubscribe(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

NodeServiceServer is the server API for NodeService service. All implementations must embed UnimplementedNodeServiceServer for forward compatibility

type NodeService_SubscribeClient

type NodeService_SubscribeClient interface {
	Recv() (*StreamMessage, error)
	grpc.ClientStream
}

type NodeService_SubscribeServer

type NodeService_SubscribeServer interface {
	Send(*StreamMessage) error
	grpc.ServerStream
}

type PluginRequest added in v0.6.3

type PluginRequest struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
	Data    []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*PluginRequest) Descriptor deprecated added in v0.6.3

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

Deprecated: Use PluginRequest.ProtoReflect.Descriptor instead.

func (*PluginRequest) GetData added in v0.6.3

func (x *PluginRequest) GetData() []byte

func (*PluginRequest) GetName added in v0.6.3

func (x *PluginRequest) GetName() string

func (*PluginRequest) GetNodeKey added in v0.6.3

func (x *PluginRequest) GetNodeKey() string

func (*PluginRequest) ProtoMessage added in v0.6.3

func (*PluginRequest) ProtoMessage()

func (*PluginRequest) ProtoReflect added in v0.6.3

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

func (*PluginRequest) Reset added in v0.6.3

func (x *PluginRequest) Reset()

func (*PluginRequest) String added in v0.6.3

func (x *PluginRequest) String() string

type PluginServiceClient

type PluginServiceClient interface {
	Register(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (*Response, error)
	Subscribe(ctx context.Context, in *PluginRequest, opts ...grpc.CallOption) (PluginService_SubscribeClient, error)
	Poll(ctx context.Context, opts ...grpc.CallOption) (PluginService_PollClient, error)
}

PluginServiceClient is the client API for PluginService 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 PluginServiceServer

type PluginServiceServer interface {
	Register(context.Context, *PluginRequest) (*Response, error)
	Subscribe(*PluginRequest, PluginService_SubscribeServer) error
	Poll(PluginService_PollServer) error
	// contains filtered or unexported methods
}

PluginServiceServer is the server API for PluginService service. All implementations must embed UnimplementedPluginServiceServer for forward compatibility

type PluginService_PollClient added in v0.6.3

type PluginService_PollClient interface {
	Send(*StreamMessage) error
	Recv() (*StreamMessage, error)
	grpc.ClientStream
}

type PluginService_PollServer added in v0.6.3

type PluginService_PollServer interface {
	Send(*StreamMessage) error
	Recv() (*StreamMessage, error)
	grpc.ServerStream
}

type PluginService_SubscribeClient

type PluginService_SubscribeClient interface {
	Recv() (*StreamMessage, error)
	grpc.ClientStream
}

type PluginService_SubscribeServer

type PluginService_SubscribeServer interface {
	Send(*StreamMessage) error
	grpc.ServerStream
}

type Request

type Request struct {
	NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
	Data    []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetData

func (x *Request) GetData() []byte

func (*Request) GetNodeKey

func (x *Request) GetNodeKey() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Code    ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=ResponseCode" json:"code,omitempty"`
	Message string       `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Data    []byte       `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Error   string       `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	Total   int64        `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetCode

func (x *Response) GetCode() ResponseCode

func (*Response) GetData

func (x *Response) GetData() []byte

func (*Response) GetError

func (x *Response) GetError() string

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) GetTotal

func (x *Response) GetTotal() int64

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type ResponseCode

type ResponseCode int32
const (
	ResponseCode_OK    ResponseCode = 0
	ResponseCode_ERROR ResponseCode = 1
)

func (ResponseCode) Descriptor

func (ResponseCode) Enum

func (x ResponseCode) Enum() *ResponseCode

func (ResponseCode) EnumDescriptor deprecated

func (ResponseCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ResponseCode.Descriptor instead.

func (ResponseCode) Number

func (ResponseCode) String

func (x ResponseCode) String() string

func (ResponseCode) Type

type StreamMessage

type StreamMessage struct {
	Code    StreamMessageCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.StreamMessageCode" json:"code,omitempty"`
	NodeKey string            `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
	Key     string            `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	From    string            `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
	To      string            `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"`
	Data    []byte            `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
	Error   string            `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamMessage) Descriptor deprecated

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

Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.

func (*StreamMessage) GetCode

func (x *StreamMessage) GetCode() StreamMessageCode

func (*StreamMessage) GetData

func (x *StreamMessage) GetData() []byte

func (*StreamMessage) GetError

func (x *StreamMessage) GetError() string

func (*StreamMessage) GetFrom added in v0.6.3

func (x *StreamMessage) GetFrom() string

func (*StreamMessage) GetKey added in v0.6.3

func (x *StreamMessage) GetKey() string

func (*StreamMessage) GetNodeKey

func (x *StreamMessage) GetNodeKey() string

func (*StreamMessage) GetTo added in v0.6.3

func (x *StreamMessage) GetTo() string

func (*StreamMessage) ProtoMessage

func (*StreamMessage) ProtoMessage()

func (*StreamMessage) ProtoReflect

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

func (*StreamMessage) Reset

func (x *StreamMessage) Reset()

func (*StreamMessage) String

func (x *StreamMessage) String() string

type StreamMessageCode

type StreamMessageCode int32
const (
	// ping worker nodes to check their health
	StreamMessageCode_PING StreamMessageCode = 0
	// ask worker node(s) to run task with given id
	StreamMessageCode_RUN_TASK StreamMessageCode = 1
	// ask worker node(s) to cancel task with given id
	StreamMessageCode_CANCEL_TASK StreamMessageCode = 2
	// insert data
	StreamMessageCode_INSERT_DATA StreamMessageCode = 3
	// insert logs
	StreamMessageCode_INSERT_LOGS StreamMessageCode = 4
	// send event
	StreamMessageCode_SEND_EVENT StreamMessageCode = 5
	// install plugin
	StreamMessageCode_INSTALL_PLUGIN StreamMessageCode = 6
	// uninstall plugin
	StreamMessageCode_UNINSTALL_PLUGIN StreamMessageCode = 7
	// start plugin
	StreamMessageCode_START_PLUGIN StreamMessageCode = 8
	// stop plugin
	StreamMessageCode_STOP_PLUGIN StreamMessageCode = 9
	// connect
	StreamMessageCode_CONNECT StreamMessageCode = 10
	// disconnect
	StreamMessageCode_DISCONNECT StreamMessageCode = 11
	// send
	StreamMessageCode_SEND StreamMessageCode = 12
)

func (StreamMessageCode) Descriptor

func (StreamMessageCode) Enum

func (StreamMessageCode) EnumDescriptor deprecated

func (StreamMessageCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use StreamMessageCode.Descriptor instead.

func (StreamMessageCode) Number

func (StreamMessageCode) String

func (x StreamMessageCode) String() string

func (StreamMessageCode) Type

type StreamMessageDataTask

type StreamMessageDataTask struct {
	TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	Data   string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamMessageDataTask) Descriptor deprecated

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

Deprecated: Use StreamMessageDataTask.ProtoReflect.Descriptor instead.

func (*StreamMessageDataTask) GetData

func (x *StreamMessageDataTask) GetData() string

func (*StreamMessageDataTask) GetTaskId

func (x *StreamMessageDataTask) GetTaskId() string

func (*StreamMessageDataTask) ProtoMessage

func (*StreamMessageDataTask) ProtoMessage()

func (*StreamMessageDataTask) ProtoReflect

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

func (*StreamMessageDataTask) Reset

func (x *StreamMessageDataTask) Reset()

func (*StreamMessageDataTask) String

func (x *StreamMessageDataTask) String() string

type Task

type Task struct {
	XId        string `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
	SpiderId   string `protobuf:"bytes,2,opt,name=spider_id,json=spiderId,proto3" json:"spider_id,omitempty"`
	Status     string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	NodeId     string `protobuf:"bytes,6,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	Cmd        string `protobuf:"bytes,8,opt,name=cmd,proto3" json:"cmd,omitempty"`
	Param      string `protobuf:"bytes,9,opt,name=param,proto3" json:"param,omitempty"`
	Error      string `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"`
	Pid        int32  `protobuf:"varint,16,opt,name=pid,proto3" json:"pid,omitempty"`
	RunType    string `protobuf:"bytes,17,opt,name=run_type,json=runType,proto3" json:"run_type,omitempty"`
	ScheduleId string `protobuf:"bytes,18,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"`
	Type       string `protobuf:"bytes,19,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetCmd

func (x *Task) GetCmd() string

func (*Task) GetError

func (x *Task) GetError() string

func (*Task) GetNodeId

func (x *Task) GetNodeId() string

func (*Task) GetParam

func (x *Task) GetParam() string

func (*Task) GetPid

func (x *Task) GetPid() int32

func (*Task) GetRunType

func (x *Task) GetRunType() string

func (*Task) GetScheduleId

func (x *Task) GetScheduleId() string

func (*Task) GetSpiderId

func (x *Task) GetSpiderId() string

func (*Task) GetStatus

func (x *Task) GetStatus() string

func (*Task) GetType

func (x *Task) GetType() string

func (*Task) GetXId

func (x *Task) GetXId() string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TaskServiceClient

type TaskServiceClient interface {
	Subscribe(ctx context.Context, opts ...grpc.CallOption) (TaskService_SubscribeClient, error)
	Fetch(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, 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 {
	Subscribe(TaskService_SubscribeServer) error
	Fetch(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

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

type TaskService_SubscribeClient

type TaskService_SubscribeClient interface {
	Send(*StreamMessage) error
	CloseAndRecv() (*Response, error)
	grpc.ClientStream
}

type TaskService_SubscribeServer

type TaskService_SubscribeServer interface {
	SendAndClose(*Response) error
	Recv() (*StreamMessage, error)
	grpc.ServerStream
}

type UnimplementedMessageServiceServer added in v0.6.3

type UnimplementedMessageServiceServer struct {
}

UnimplementedMessageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMessageServiceServer) Connect added in v0.6.3

type UnimplementedModelBaseServiceServer

type UnimplementedModelBaseServiceServer struct {
}

UnimplementedModelBaseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedModelBaseServiceServer) Count

func (UnimplementedModelBaseServiceServer) Delete

func (UnimplementedModelBaseServiceServer) DeleteById

func (UnimplementedModelBaseServiceServer) DeleteList

func (UnimplementedModelBaseServiceServer) ForceDeleteList

func (UnimplementedModelBaseServiceServer) Get

func (UnimplementedModelBaseServiceServer) GetById

func (UnimplementedModelBaseServiceServer) GetList

func (UnimplementedModelBaseServiceServer) Insert

func (UnimplementedModelBaseServiceServer) Update

func (UnimplementedModelBaseServiceServer) UpdateById

func (UnimplementedModelBaseServiceServer) UpdateDoc

type UnimplementedModelBaseServiceV2Server added in v0.6.3

type UnimplementedModelBaseServiceV2Server struct {
}

UnimplementedModelBaseServiceV2Server must be embedded to have forward compatible implementations.

func (UnimplementedModelBaseServiceV2Server) Count added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) DeleteById added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) DeleteList added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) Get added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) GetById added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) GetList added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) InsertMany added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) InsertOne added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) Replace added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) ReplaceById added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) UpdateById added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) UpdateMany added in v0.6.3

func (UnimplementedModelBaseServiceV2Server) UpdateOne added in v0.6.3

type UnimplementedModelDelegateServer

type UnimplementedModelDelegateServer struct {
}

UnimplementedModelDelegateServer must be embedded to have forward compatible implementations.

func (UnimplementedModelDelegateServer) Do

type UnimplementedNodeServiceServer

type UnimplementedNodeServiceServer struct {
}

UnimplementedNodeServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeServiceServer) Ping

func (UnimplementedNodeServiceServer) Register

func (UnimplementedNodeServiceServer) SendHeartbeat

func (UnimplementedNodeServiceServer) Subscribe

func (UnimplementedNodeServiceServer) Unsubscribe

type UnimplementedPluginServiceServer

type UnimplementedPluginServiceServer struct {
}

UnimplementedPluginServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPluginServiceServer) Poll added in v0.6.3

func (UnimplementedPluginServiceServer) Register

func (UnimplementedPluginServiceServer) Subscribe

type UnimplementedTaskServiceServer

type UnimplementedTaskServiceServer struct {
}

UnimplementedTaskServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTaskServiceServer) Fetch added in v0.6.3

func (UnimplementedTaskServiceServer) Subscribe

type UnsafeMessageServiceServer added in v0.6.3

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

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

type UnsafeModelBaseServiceServer

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

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

type UnsafeModelBaseServiceV2Server added in v0.6.3

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

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

type UnsafeModelDelegateServer

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

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

type UnsafeNodeServiceServer

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

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

type UnsafePluginServiceServer

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

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

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.

Jump to

Keyboard shortcuts

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