Documentation ¶
Index ¶
- func GetServer(path string, opts ...Option) (svr interfaces.GrpcServer, err error)
- func HandleError(err error) (res *grpc.Response, err2 error)
- func HandleSuccess() (res *grpc.Response, err error)
- func HandleSuccessWithData(data interface{}) (res *grpc.Response, err error)
- func HandleSuccessWithListData(data interface{}, total int) (res *grpc.Response, err error)
- func NewServer(opts ...Option) (svr2 interfaces.GrpcServer, err error)
- func ProvideGetServer(path string, opts ...Option) func() (svr interfaces.GrpcServer, err error)
- func ProvideMessageServer(server interfaces.GrpcServer, opts ...MessageServerOption) func() (res *MessageServer, err error)
- func ProvideNodeServer(server interfaces.GrpcServer, opts ...NodeServerOption) func() (res *NodeServer, err error)
- func ProvidePluginServer(server interfaces.GrpcServer, opts ...PluginServerOption) func() (res *PluginServer, err error)
- func ProvideServer(path string, opts ...Option) func() (res interfaces.GrpcServer, err error)
- func ProvideTaskServer(server interfaces.GrpcServer, opts ...TaskServerOption) func() (res *TaskServer, err error)
- type MessageServer
- type MessageServerOption
- type ModelBaseServiceBinder
- type ModelBaseServiceServer
- func (svr ModelBaseServiceServer) Count(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) Delete(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) DeleteById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) DeleteList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) ForceDeleteList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) Get(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) GetById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) GetList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) Insert(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) Update(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) UpdateById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServer) UpdateDoc(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- type ModelDelegateBinder
- type ModelDelegateServer
- type NodeServer
- func (svr NodeServer) Ping(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr NodeServer) Register(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr NodeServer) SendHeartbeat(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- func (svr NodeServer) Subscribe(request *grpc.Request, stream grpc.NodeService_SubscribeServer) (err error)
- func (svr NodeServer) Unsubscribe(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
- type NodeServerOption
- type Option
- type PluginServer
- func (svr PluginServer) Poll(stream grpc.PluginService_PollServer) (err error)
- func (svr PluginServer) Register(ctx context.Context, req *grpc.PluginRequest) (res *grpc.Response, err error)
- func (svr PluginServer) Subscribe(req *grpc.PluginRequest, stream grpc.PluginService_SubscribeServer) (err error)
- type PluginServerOption
- type Server
- func (svr *Server) DeleteSubscribe(key string)
- func (svr *Server) GetConfigPath() (path string)
- func (svr *Server) GetSubscribe(key string) (sub interfaces.GrpcSubscribe, err error)
- func (svr *Server) Init() (err error)
- func (svr *Server) IsStopped() (res bool)
- func (svr *Server) Register() (err error)
- func (svr *Server) SendStreamMessage(key string, code grpc2.StreamMessageCode) (err error)
- func (svr *Server) SendStreamMessageWithData(key string, code grpc2.StreamMessageCode, d interface{}) (err error)
- func (svr *Server) SetAddress(address interfaces.Address)
- func (svr *Server) SetConfigPath(path string)
- func (svr *Server) SetSubscribe(key string, sub interfaces.GrpcSubscribe)
- func (svr *Server) Start() (err error)
- func (svr *Server) Stop() (err error)
- type TaskServer
- type TaskServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServer ¶
func GetServer(path string, opts ...Option) (svr interfaces.GrpcServer, err error)
func HandleError ¶
func HandleSuccess ¶
func HandleSuccess() (res *grpc.Response, err error)
func HandleSuccessWithData ¶
func HandleSuccessWithData(data interface{}) (res *grpc.Response, err error)
func NewServer ¶
func NewServer(opts ...Option) (svr2 interfaces.GrpcServer, err error)
func ProvideGetServer ¶
func ProvideGetServer(path string, opts ...Option) func() (svr interfaces.GrpcServer, err error)
func ProvideMessageServer ¶
func ProvideMessageServer(server interfaces.GrpcServer, opts ...MessageServerOption) func() (res *MessageServer, err error)
func ProvideNodeServer ¶
func ProvideNodeServer(server interfaces.GrpcServer, opts ...NodeServerOption) func() (res *NodeServer, err error)
func ProvidePluginServer ¶
func ProvidePluginServer(server interfaces.GrpcServer, opts ...PluginServerOption) func() (res *PluginServer, err error)
func ProvideServer ¶
func ProvideServer(path string, opts ...Option) func() (res interfaces.GrpcServer, err error)
func ProvideTaskServer ¶
func ProvideTaskServer(server interfaces.GrpcServer, opts ...TaskServerOption) func() (res *TaskServer, err error)
Types ¶
type MessageServer ¶
type MessageServer struct { grpc.UnimplementedMessageServiceServer // contains filtered or unexported fields }
func NewMessageServer ¶
func NewMessageServer(opts ...MessageServerOption) (res *MessageServer, err error)
func (MessageServer) Connect ¶
func (svr MessageServer) Connect(stream grpc.MessageService_ConnectServer) (err error)
type MessageServerOption ¶
type MessageServerOption func(svr *MessageServer)
func WithServerMessageServerService ¶
func WithServerMessageServerService(server interfaces.GrpcServer) MessageServerOption
type ModelBaseServiceBinder ¶
type ModelBaseServiceBinder struct {
// contains filtered or unexported fields
}
func NewModelBaseServiceBinder ¶
func NewModelBaseServiceBinder(req *grpc.Request) (b *ModelBaseServiceBinder)
func (*ModelBaseServiceBinder) Bind ¶
func (b *ModelBaseServiceBinder) Bind() (res *entity.GrpcBaseServiceParams, err error)
func (*ModelBaseServiceBinder) BindWithBaseServiceMessage ¶
func (b *ModelBaseServiceBinder) BindWithBaseServiceMessage() (params *entity.GrpcBaseServiceParams, msg interfaces.GrpcModelBaseServiceMessage, err error)
func (*ModelBaseServiceBinder) MustBind ¶
func (b *ModelBaseServiceBinder) MustBind() (res interface{})
type ModelBaseServiceServer ¶
type ModelBaseServiceServer struct { grpc.UnimplementedModelBaseServiceServer // contains filtered or unexported fields }
func NewModelBaseServiceServer ¶
func NewModelBaseServiceServer() (svr2 *ModelBaseServiceServer, err error)
func (ModelBaseServiceServer) DeleteById ¶
func (ModelBaseServiceServer) DeleteList ¶
func (ModelBaseServiceServer) ForceDeleteList ¶
func (ModelBaseServiceServer) UpdateById ¶
type ModelDelegateBinder ¶
type ModelDelegateBinder struct {
// contains filtered or unexported fields
}
func NewModelDelegateBinder ¶
func NewModelDelegateBinder(req *grpc.Request) (b *ModelDelegateBinder)
func (*ModelDelegateBinder) Bind ¶
func (b *ModelDelegateBinder) Bind() (res interface{}, err error)
func (*ModelDelegateBinder) BindWithDelegateMessage ¶
func (b *ModelDelegateBinder) BindWithDelegateMessage() (res interface{}, msg interfaces.GrpcModelDelegateMessage, err error)
func (*ModelDelegateBinder) MustBind ¶
func (b *ModelDelegateBinder) MustBind() (res interface{})
type ModelDelegateServer ¶
type ModelDelegateServer struct {
grpc.UnimplementedModelDelegateServer
}
func NewModelDelegateServer ¶
func NewModelDelegateServer() (svr *ModelDelegateServer)
type NodeServer ¶
type NodeServer struct { grpc.UnimplementedNodeServiceServer // contains filtered or unexported fields }
func NewNodeServer ¶
func NewNodeServer(opts ...NodeServerOption) (res *NodeServer, err error)
func (NodeServer) Ping ¶
func (svr NodeServer) Ping(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
Ping from worker to master
func (NodeServer) Register ¶
func (svr NodeServer) Register(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
Register from handler/worker to master
func (NodeServer) SendHeartbeat ¶
func (svr NodeServer) SendHeartbeat(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
SendHeartbeat from worker to master
func (NodeServer) Subscribe ¶
func (svr NodeServer) Subscribe(request *grpc.Request, stream grpc.NodeService_SubscribeServer) (err error)
func (NodeServer) Unsubscribe ¶
func (svr NodeServer) Unsubscribe(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)
type NodeServerOption ¶
type NodeServerOption func(svr *NodeServer)
func WithServerNodeServerService ¶
func WithServerNodeServerService(server interfaces.GrpcServer) NodeServerOption
type Option ¶
type Option func(svr interfaces.GrpcServer)
func WithAddress ¶
func WithAddress(address interfaces.Address) Option
func WithConfigPath ¶
type PluginServer ¶
type PluginServer struct { grpc.UnimplementedPluginServiceServer // contains filtered or unexported fields }
func NewPluginServer ¶
func NewPluginServer(opts ...PluginServerOption) (res *PluginServer, err error)
func (PluginServer) Poll ¶
func (svr PluginServer) Poll(stream grpc.PluginService_PollServer) (err error)
func (PluginServer) Register ¶
func (svr PluginServer) Register(ctx context.Context, req *grpc.PluginRequest) (res *grpc.Response, err error)
func (PluginServer) Subscribe ¶
func (svr PluginServer) Subscribe(req *grpc.PluginRequest, stream grpc.PluginService_SubscribeServer) (err error)
type PluginServerOption ¶
type PluginServerOption func(svr *PluginServer)
func WithServerPluginServerService ¶
func WithServerPluginServerService(server interfaces.GrpcServer) PluginServerOption
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) DeleteSubscribe ¶
func (*Server) GetConfigPath ¶
func (*Server) GetSubscribe ¶
func (svr *Server) GetSubscribe(key string) (sub interfaces.GrpcSubscribe, err error)
func (*Server) SendStreamMessage ¶
func (svr *Server) SendStreamMessage(key string, code grpc2.StreamMessageCode) (err error)
func (*Server) SendStreamMessageWithData ¶
func (svr *Server) SendStreamMessageWithData(key string, code grpc2.StreamMessageCode, d interface{}) (err error)
func (*Server) SetAddress ¶
func (svr *Server) SetAddress(address interfaces.Address)
func (*Server) SetConfigPath ¶
func (*Server) SetSubscribe ¶
func (svr *Server) SetSubscribe(key string, sub interfaces.GrpcSubscribe)
type TaskServer ¶
type TaskServer struct { grpc.UnimplementedTaskServiceServer // contains filtered or unexported fields }
func NewTaskServer ¶
func NewTaskServer(opts ...TaskServerOption) (res *TaskServer, err error)
func (TaskServer) Fetch ¶
func (svr TaskServer) Fetch(ctx context.Context, request *grpc.Request) (response *grpc.Response, err error)
Fetch tasks to be executed by a task handler
func (TaskServer) Subscribe ¶
func (svr TaskServer) Subscribe(stream grpc.TaskService_SubscribeServer) (err error)
Subscribe to task stream when a task runner in a node starts
type TaskServerOption ¶
type TaskServerOption func(svr *TaskServer)
func WithServerTaskServerService ¶
func WithServerTaskServerService(server interfaces.GrpcServer) TaskServerOption
Click to show internal directories.
Click to hide internal directories.