Documentation ¶
Index ¶
- func GetModelService[T any](typeName string) *service.ModelServiceV2[T]
- func GetOneInstanceModel(typeName string) any
- 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)
- type DependenciesServerV2
- func (svr DependenciesServerV2) Connect(req *grpc.DependenciesServiceV2ConnectRequest, ...) (err error)
- func (svr DependenciesServerV2) GetStream(key string) (stream *grpc.DependenciesServiceV2_ConnectServer, err error)
- func (svr DependenciesServerV2) Sync(ctx context.Context, request *grpc.DependenciesServiceV2SyncRequest) (response *grpc.Response, err error)
- func (svr DependenciesServerV2) UpdateTaskLog(stream grpc.DependenciesServiceV2_UpdateTaskLogServer) (err error)
- type GrpcServerV2
- func (svr *GrpcServerV2) DeleteSubscribe(key string)
- func (svr *GrpcServerV2) GetConfigPath() (path string)
- func (svr *GrpcServerV2) GetSubscribe(key string) (sub interfaces.GrpcSubscribe, err error)
- func (svr *GrpcServerV2) Init() (err error)
- func (svr *GrpcServerV2) IsStopped() (res bool)
- func (svr *GrpcServerV2) Register() (err error)
- func (svr *GrpcServerV2) SendStreamMessage(key string, code grpc2.StreamMessageCode) (err error)
- func (svr *GrpcServerV2) SendStreamMessageWithData(key string, code grpc2.StreamMessageCode, d interface{}) (err error)
- func (svr *GrpcServerV2) SetAddress(address interfaces.Address)
- func (svr *GrpcServerV2) SetConfigPath(path string)
- func (svr *GrpcServerV2) SetSubscribe(key string, sub interfaces.GrpcSubscribe)
- func (svr *GrpcServerV2) Start() (err error)
- func (svr *GrpcServerV2) Stop() (err error)
- type MessageServer
- type MetricsServerV2
- 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 ModelBaseServiceServerV2
- func (svr ModelBaseServiceServerV2) Count(_ context.Context, req *grpc.ModelServiceV2CountRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) DeleteById(_ context.Context, req *grpc.ModelServiceV2DeleteByIdRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) DeleteMany(_ context.Context, req *grpc.ModelServiceV2DeleteManyRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) DeleteOne(_ context.Context, req *grpc.ModelServiceV2DeleteOneRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) GetById(_ context.Context, req *grpc.ModelServiceV2GetByIdRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) GetMany(_ context.Context, req *grpc.ModelServiceV2GetManyRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) GetOne(_ context.Context, req *grpc.ModelServiceV2GetOneRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) InsertMany(_ context.Context, req *grpc.ModelServiceV2InsertManyRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) InsertOne(_ context.Context, req *grpc.ModelServiceV2InsertOneRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) ReplaceById(_ context.Context, req *grpc.ModelServiceV2ReplaceByIdRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) ReplaceOne(_ context.Context, req *grpc.ModelServiceV2ReplaceOneRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) UpdateById(_ context.Context, req *grpc.ModelServiceV2UpdateByIdRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) UpdateMany(_ context.Context, req *grpc.ModelServiceV2UpdateManyRequest) (res *grpc.Response, err error)
- func (svr ModelBaseServiceServerV2) UpdateOne(_ context.Context, req *grpc.ModelServiceV2UpdateOneRequest) (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 NodeServerV2
- func (svr NodeServerV2) Register(_ context.Context, req *grpc.NodeServiceRegisterRequest) (res *grpc.Response, err error)
- func (svr NodeServerV2) SendHeartbeat(_ context.Context, req *grpc.NodeServiceSendHeartbeatRequest) (res *grpc.Response, err error)
- func (svr NodeServerV2) Subscribe(request *grpc.Request, stream grpc.NodeService_SubscribeServer) (err error)
- func (svr NodeServerV2) Unsubscribe(_ context.Context, req *grpc.Request) (res *grpc.Response, err error)
- type TaskServerV2
- func (svr TaskServerV2) Fetch(ctx context.Context, request *grpc.Request) (response *grpc.Response, err error)
- func (svr TaskServerV2) SendNotification(_ context.Context, request *grpc.TaskServiceSendNotificationRequest) (response *grpc.Response, err error)
- func (svr TaskServerV2) Subscribe(stream grpc.TaskService_SubscribeServer) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModelService ¶
func GetModelService[T any](typeName string) *service.ModelServiceV2[T]
func GetOneInstanceModel ¶
func HandleSuccess ¶
func HandleSuccessWithData ¶
Types ¶
type DependenciesServerV2 ¶
type DependenciesServerV2 struct { grpc.UnimplementedDependenciesServiceV2Server // contains filtered or unexported fields }
func GetDependenciesServerV2 ¶
func GetDependenciesServerV2() *DependenciesServerV2
func NewDependenciesServerV2 ¶
func NewDependenciesServerV2() *DependenciesServerV2
func (DependenciesServerV2) Connect ¶
func (svr DependenciesServerV2) Connect(req *grpc.DependenciesServiceV2ConnectRequest, stream grpc.DependenciesServiceV2_ConnectServer) (err error)
func (DependenciesServerV2) GetStream ¶
func (svr DependenciesServerV2) GetStream(key string) (stream *grpc.DependenciesServiceV2_ConnectServer, err error)
func (DependenciesServerV2) Sync ¶
func (svr DependenciesServerV2) Sync(ctx context.Context, request *grpc.DependenciesServiceV2SyncRequest) (response *grpc.Response, err error)
func (DependenciesServerV2) UpdateTaskLog ¶
func (svr DependenciesServerV2) UpdateTaskLog(stream grpc.DependenciesServiceV2_UpdateTaskLogServer) (err error)
type GrpcServerV2 ¶
type GrpcServerV2 struct { // servers NodeSvr *NodeServerV2 TaskSvr *TaskServerV2 ModelBaseServiceSvr *ModelBaseServiceServerV2 DependenciesSvr *DependenciesServerV2 MetricsSvr *MetricsServerV2 // contains filtered or unexported fields }
func GetGrpcServerV2 ¶
func GetGrpcServerV2() (svr *GrpcServerV2, err error)
func NewGrpcServerV2 ¶
func NewGrpcServerV2() (svr *GrpcServerV2, err error)
func (*GrpcServerV2) DeleteSubscribe ¶
func (svr *GrpcServerV2) DeleteSubscribe(key string)
func (*GrpcServerV2) GetConfigPath ¶
func (svr *GrpcServerV2) GetConfigPath() (path string)
func (*GrpcServerV2) GetSubscribe ¶
func (svr *GrpcServerV2) GetSubscribe(key string) (sub interfaces.GrpcSubscribe, err error)
func (*GrpcServerV2) Init ¶
func (svr *GrpcServerV2) Init() (err error)
func (*GrpcServerV2) IsStopped ¶
func (svr *GrpcServerV2) IsStopped() (res bool)
func (*GrpcServerV2) Register ¶
func (svr *GrpcServerV2) Register() (err error)
func (*GrpcServerV2) SendStreamMessage ¶
func (svr *GrpcServerV2) SendStreamMessage(key string, code grpc2.StreamMessageCode) (err error)
func (*GrpcServerV2) SendStreamMessageWithData ¶
func (svr *GrpcServerV2) SendStreamMessageWithData(key string, code grpc2.StreamMessageCode, d interface{}) (err error)
func (*GrpcServerV2) SetAddress ¶
func (svr *GrpcServerV2) SetAddress(address interfaces.Address)
func (*GrpcServerV2) SetConfigPath ¶
func (svr *GrpcServerV2) SetConfigPath(path string)
func (*GrpcServerV2) SetSubscribe ¶
func (svr *GrpcServerV2) SetSubscribe(key string, sub interfaces.GrpcSubscribe)
func (*GrpcServerV2) Start ¶
func (svr *GrpcServerV2) Start() (err error)
func (*GrpcServerV2) Stop ¶
func (svr *GrpcServerV2) Stop() (err error)
type MessageServer ¶
type MessageServer struct { grpc.UnimplementedMessageServiceServer // contains filtered or unexported fields }
func NewMessageServer ¶
func NewMessageServer() (res *MessageServer, err error)
func (MessageServer) Connect ¶
func (svr MessageServer) Connect(stream grpc.MessageService_ConnectServer) (err error)
type MetricsServerV2 ¶
type MetricsServerV2 struct {
grpc.UnimplementedMetricsServiceV2Server
}
func GetMetricsServerV2 ¶
func GetMetricsServerV2() *MetricsServerV2
func (MetricsServerV2) Send ¶
func (svr MetricsServerV2) Send(_ context.Context, req *grpc.MetricsServiceV2SendRequest) (res *grpc.Response, err error)
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 ModelBaseServiceServerV2 ¶
type ModelBaseServiceServerV2 struct {
grpc.UnimplementedModelBaseServiceV2Server
}
func NewModelBaseServiceV2Server ¶
func NewModelBaseServiceV2Server() *ModelBaseServiceServerV2
func (ModelBaseServiceServerV2) Count ¶
func (svr ModelBaseServiceServerV2) Count(_ context.Context, req *grpc.ModelServiceV2CountRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) DeleteById ¶
func (svr ModelBaseServiceServerV2) DeleteById(_ context.Context, req *grpc.ModelServiceV2DeleteByIdRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) DeleteMany ¶
func (svr ModelBaseServiceServerV2) DeleteMany(_ context.Context, req *grpc.ModelServiceV2DeleteManyRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) DeleteOne ¶
func (svr ModelBaseServiceServerV2) DeleteOne(_ context.Context, req *grpc.ModelServiceV2DeleteOneRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) GetById ¶
func (svr ModelBaseServiceServerV2) GetById(_ context.Context, req *grpc.ModelServiceV2GetByIdRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) GetMany ¶
func (svr ModelBaseServiceServerV2) GetMany(_ context.Context, req *grpc.ModelServiceV2GetManyRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) GetOne ¶
func (svr ModelBaseServiceServerV2) GetOne(_ context.Context, req *grpc.ModelServiceV2GetOneRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) InsertMany ¶
func (svr ModelBaseServiceServerV2) InsertMany(_ context.Context, req *grpc.ModelServiceV2InsertManyRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) InsertOne ¶
func (svr ModelBaseServiceServerV2) InsertOne(_ context.Context, req *grpc.ModelServiceV2InsertOneRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) ReplaceById ¶
func (svr ModelBaseServiceServerV2) ReplaceById(_ context.Context, req *grpc.ModelServiceV2ReplaceByIdRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) ReplaceOne ¶
func (svr ModelBaseServiceServerV2) ReplaceOne(_ context.Context, req *grpc.ModelServiceV2ReplaceOneRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) UpdateById ¶
func (svr ModelBaseServiceServerV2) UpdateById(_ context.Context, req *grpc.ModelServiceV2UpdateByIdRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) UpdateMany ¶
func (svr ModelBaseServiceServerV2) UpdateMany(_ context.Context, req *grpc.ModelServiceV2UpdateManyRequest) (res *grpc.Response, err error)
func (ModelBaseServiceServerV2) UpdateOne ¶
func (svr ModelBaseServiceServerV2) UpdateOne(_ context.Context, req *grpc.ModelServiceV2UpdateOneRequest) (res *grpc.Response, err error)
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() (res *NodeServer, err error)
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 ¶
type NodeServerV2 ¶
type NodeServerV2 struct { grpc.UnimplementedNodeServiceServer // contains filtered or unexported fields }
func NewNodeServerV2 ¶
func NewNodeServerV2() (res *NodeServerV2, err error)
func (NodeServerV2) Register ¶
func (svr NodeServerV2) Register(_ context.Context, req *grpc.NodeServiceRegisterRequest) (res *grpc.Response, err error)
Register from handler/worker to master
func (NodeServerV2) SendHeartbeat ¶
func (svr NodeServerV2) SendHeartbeat(_ context.Context, req *grpc.NodeServiceSendHeartbeatRequest) (res *grpc.Response, err error)
SendHeartbeat from worker to master
func (NodeServerV2) Subscribe ¶
func (svr NodeServerV2) Subscribe(request *grpc.Request, stream grpc.NodeService_SubscribeServer) (err error)
func (NodeServerV2) Unsubscribe ¶
type TaskServerV2 ¶
type TaskServerV2 struct { grpc.UnimplementedTaskServiceServer // contains filtered or unexported fields }
func NewTaskServerV2 ¶
func NewTaskServerV2() (res *TaskServerV2, err error)
func (TaskServerV2) Fetch ¶
func (svr TaskServerV2) Fetch(ctx context.Context, request *grpc.Request) (response *grpc.Response, err error)
Fetch tasks to be executed by a task handler
func (TaskServerV2) SendNotification ¶
func (svr TaskServerV2) SendNotification(_ context.Context, request *grpc.TaskServiceSendNotificationRequest) (response *grpc.Response, err error)
func (TaskServerV2) Subscribe ¶
func (svr TaskServerV2) Subscribe(stream grpc.TaskService_SubscribeServer) (err error)
Subscribe to task stream when a task runner in a node starts
Source Files ¶
Click to show internal directories.
Click to hide internal directories.