grpc

package
v0.0.0-...-2119b44 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MPL-2.0 Imports: 16 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGrpcConn

func CreateGrpcConn(conf config.GrpcService) *grpc.ClientConn

func NewDefaultHealthChecker

func NewDefaultHealthChecker() pb.HealthServer

func SqlErrorToGrpc

func SqlErrorToGrpc(err error, entity string) error

Returns grpc error with code based on Sql error. Handles cases such as "not found" or "duplicate key"

Types

type HealthChecker

type HealthChecker struct {
	pb.UnimplementedHealthServer
}

func (*HealthChecker) Check

func (*HealthChecker) Watch

func (s *HealthChecker) Watch(request *pb.HealthCheckRequest, server pb.Health_WatchServer) error

type HealthCheckerInterface

type HealthCheckerInterface interface {
	Check(ctx context.Context, request *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
	Watch(request *pb.HealthCheckRequest, server pb.Health_WatchServer) error
}

type UkamaGrpcServer

type UkamaGrpcServer struct {
	ExtraUnaryInterceptors  []grpc.UnaryServerInterceptor
	ExtraStreamInterceptors []grpc.StreamServerInterceptor
	// contains filtered or unexported fields
}

Basic GrpcServer with the set of middlewares

func NewGrpcServer

func NewGrpcServer(config config.Grpc, serviceRegistrar func(s *grpc.Server)) *UkamaGrpcServer

func NewGrpcServerWithCustomHealthcheck

func NewGrpcServerWithCustomHealthcheck(healthChecker *HealthChecker, config config.Grpc, serviceRegistrator func(s *grpc.Server)) *UkamaGrpcServer

func (*UkamaGrpcServer) StartServer

func (g *UkamaGrpcServer) StartServer()

func (*UkamaGrpcServer) StopServer

func (g *UkamaGrpcServer) StopServer()

Jump to

Keyboard shortcuts

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