abs

package
v0.0.0-...-fa223cd Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 NewMetrics(serviceName string) *Metrics

func (*Metrics) GetServiceName

func (o *Metrics) GetServiceName() string

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

func NewService(ctx *core.Context, name string, config core.ServiceConfig) *Service

Instanciate the service without dependency because it's role of ServiceFactory

func (*Service) Create

func (o *Service) Create(ctx context.Context, in *empty.Empty) (*pb.Response, error)

Endpoint :

  • grpc : Create
  • http : POST /abs

func (*Service) Delete

func (o *Service) Delete(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)

Endpoint :

  • grpc : Delete
  • http : DELETE /abs/{id}

func (*Service) Get

func (o *Service) Get(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)

Endpoint :

  • grpc : Get
  • http : GET /abs/{id}

func (*Service) GetClient

func (o *Service) GetClient(conn *grpc.ClientConn) any

func (*Service) GetHandler

func (o *Service) GetHandler() core.GoMsHandlerInterface

Get Handler describe in the interface

func (*Service) GetMiddlewaresConf

func (o *Service) GetMiddlewaresConf() map[string][]string

func (*Service) GetName

func (o *Service) GetName() string

Get the service name

func (*Service) List

func (o *Service) List(ctx context.Context, in *empty.Empty) (*pb.Response, error)

Endpoint :

  • grpc : List
  • http : Get /abs

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)

func (*Service) Update

func (o *Service) Update(ctx context.Context, in *pb.EntityRequest) (*pb.Response, error)

Endpoint :

  • grpc : Update
  • http : PATCH /abs/{id}

Directories

Path Synopsis
Package protobuf is a reverse proxy.
Package protobuf is a reverse proxy.

Jump to

Keyboard shortcuts

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