Documentation ¶
Index ¶
- func NewHandler() core.GoMsHandlerInterface
- type Handler
- type Metrics
- type Service
- func (o *Service) Create(ctx context.Context, in *empty.Empty) (*pb.Response, error)
- func (o *Service) Delete(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)
- func (o *Service) Get(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)
- func (o *Service) GetClient(conn *grpc.ClientConn) any
- func (o *Service) GetHandler() core.GoMsHandlerInterface
- func (o *Service) GetMiddlewaresConf() map[string][]string
- func (o *Service) GetName() string
- func (o *Service) List(ctx context.Context, in *empty.Empty) (*pb.Response, error)
- func (o *Service) RegisterGrpc(gs *core.GoMsGrpcServer)
- func (o *Service) RegisterHttp(gh *core.GoMsHttpServer, endpoint string) error
- func (o *Service) SetClientManager(clientManager *core.GrpcClientManager)
- func (o *Service) Update(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler() core.GoMsHandlerInterface
Types ¶
type Handler ¶
type Handler struct{}
func (*Handler) RegisterGrpc ¶
func (o *Handler) RegisterGrpc(gs *core.GoMsGrpcServer, s core.GoMsServiceInterface)
func (*Handler) RegisterHttp ¶
func (o *Handler) RegisterHttp(gh *core.GoMsHttpServer, s core.GoMsServiceInterface) error
type Metrics ¶
type Metrics struct {
ServiceName string
}
func NewMetrics ¶
func (*Metrics) GetServiceName ¶
type Service ¶
type Service struct { Name string Ctx *core.Context Handler core.GoMsHandlerInterface Metrics *Metrics Client pb.AbsClient ClientManager *core.GrpcClientManager pb.UnimplementedAbsServer // contains filtered or unexported fields }
Define the service structure
func NewService ¶
Instanciate the service without dependency because it's role of ServiceFactory
func (*Service) GetHandler ¶
func (o *Service) GetHandler() core.GoMsHandlerInterface
Get Handler describe in the interface
func (*Service) GetMiddlewaresConf ¶
func (*Service) RegisterGrpc ¶
func (o *Service) RegisterGrpc(gs *core.GoMsGrpcServer)
This method is required for redister your service on the Grpc server
func (*Service) RegisterHttp ¶
func (o *Service) RegisterHttp(gh *core.GoMsHttpServer, endpoint string) error
This method is required for redister your service on the Http server
func (*Service) SetClientManager ¶
func (o *Service) SetClientManager(clientManager *core.GrpcClientManager)
Click to show internal directories.
Click to hide internal directories.