server

package
v0.0.0-...-0485310 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

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 GetOneInstanceModel(typeName string) any

func HandleError

func HandleError(err error) (res *grpc.Response, err2 error)

func HandleSuccess

func HandleSuccess() (res *grpc.Response, err error)

func HandleSuccessWithData

func HandleSuccessWithData(data interface{}) (res *grpc.Response, err error)

func HandleSuccessWithListData

func HandleSuccessWithListData(data interface{}, total int) (res *grpc.Response, err error)

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 (DependenciesServerV2) GetStream

func (svr DependenciesServerV2) GetStream(key string) (stream *grpc.DependenciesServiceV2_ConnectServer, err error)

func (DependenciesServerV2) Sync

func (DependenciesServerV2) UpdateTaskLog

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

type ModelBaseServiceBinder

type ModelBaseServiceBinder struct {
	// contains filtered or unexported fields
}

func NewModelBaseServiceBinder

func NewModelBaseServiceBinder(req *grpc.Request) (b *ModelBaseServiceBinder)

func (*ModelBaseServiceBinder) Bind

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) Count

func (svr ModelBaseServiceServer) Count(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) Delete

func (svr ModelBaseServiceServer) Delete(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) DeleteById

func (svr ModelBaseServiceServer) DeleteById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) DeleteList

func (svr ModelBaseServiceServer) DeleteList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) ForceDeleteList

func (svr ModelBaseServiceServer) ForceDeleteList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) Get

func (svr ModelBaseServiceServer) Get(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) GetById

func (svr ModelBaseServiceServer) GetById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) GetList

func (svr ModelBaseServiceServer) GetList(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) Insert

func (svr ModelBaseServiceServer) Insert(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) Update

func (svr ModelBaseServiceServer) Update(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) UpdateById

func (svr ModelBaseServiceServer) UpdateById(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

func (ModelBaseServiceServer) UpdateDoc

func (svr ModelBaseServiceServer) UpdateDoc(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

type ModelBaseServiceServerV2

type ModelBaseServiceServerV2 struct {
	grpc.UnimplementedModelBaseServiceV2Server
}

func NewModelBaseServiceV2Server

func NewModelBaseServiceV2Server() *ModelBaseServiceServerV2

func (ModelBaseServiceServerV2) Count

func (ModelBaseServiceServerV2) DeleteById

func (ModelBaseServiceServerV2) DeleteMany

func (ModelBaseServiceServerV2) DeleteOne

func (ModelBaseServiceServerV2) GetById

func (ModelBaseServiceServerV2) GetMany

func (ModelBaseServiceServerV2) GetOne

func (ModelBaseServiceServerV2) InsertMany

func (ModelBaseServiceServerV2) InsertOne

func (ModelBaseServiceServerV2) ReplaceById

func (ModelBaseServiceServerV2) ReplaceOne

func (ModelBaseServiceServerV2) UpdateById

func (ModelBaseServiceServerV2) UpdateMany

func (ModelBaseServiceServerV2) UpdateOne

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)

func (ModelDelegateServer) Do

func (svr ModelDelegateServer) Do(ctx context.Context, req *grpc.Request) (res *grpc.Response, err error)

Do and perform an RPC action of constants.Delegate

type NodeServer

type NodeServer struct {
	grpc.UnimplementedNodeServiceServer
	// contains filtered or unexported fields
}

func NewNodeServer

func NewNodeServer() (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 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

func (svr NodeServerV2) Unsubscribe(_ context.Context, req *grpc.Request) (res *grpc.Response, err error)

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

Jump to

Keyboard shortcuts

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