Categorygithub.com/dohernandez/servers
modulepackage
0.12.0
Repository: https://github.com/dohernandez/servers.git
Documentation: pkg.go.dev

# README

servers

# Functions

No description provided by the author
Info returns app version info.
NewGRPC initiates a new wrapped grpc server.
NewGRPCRest initiates a new wrapped grpc rest server.
NewHealthCheck is a listening HTTP server instance with the endpoints "/" and "/health" mainly use for livenessProbe and readinessProbe on Kubernetes cluster.
NewMetrics initiates a new wrapped prom server collector.
NewPProf creates a new REST service dedicated to serving pprof routes.
NewREST constructs a new rest Server.
NewRestAPIDocsHandlers creates a handler for an endpoint to response on /docs path to show the api documentation.
NewRestRootHandler creates a handler for an endpoint to response on / path.
NewRestVersionHandler creates a handler for an endpoint to response on /version path to show the version of the api.
NewServer constructs a new Server.
WithAddrAssigned sets service to ask for listener assigned address.
WithChainStreamInterceptor sets the server interceptors for stream.
WithChainUnaryInterceptor sets the server interceptors for unary.
WithCollector add collectors to the metrics.
WithDocEndpoint sets the options for the mux server to serve API docs.
WithExposeAt sets the path to expose the metrics.
WithGRPCObserver sets the GRPCObserver collector manager, used to append UnaryServerInterceptor and StreamServerInterceptor Apply to GRPC server instances.
WithGRPCServer sets the GRPC server.
WithHandlers sets the options for custom path handlers to the mux server.
WithHealthCheck sets service to enable health check.
WithListener sets the listener.
WithLogger sets service to use logger.
WithReflection sets service to implement reflection.
WithRegisterService registers a service.
WithRegisterServiceHandler registers a service handler to the mux server.
WithResponseModifier sets the options for custom response modifier to the mux server.
WithServerMuxOption sets the options for the mux server.
WithServerOption sets the options for the grpc server.
WithVersionEndpoint sets the options for the mux server to serve version.

# Variables

ErrCollectorAppended is returned when attempting to append a collector that already exists.
ErrGRPCStart is returned when an error occurs the GRPC server start.
ErrListenerFailedStart is returned when an error occurs starting listener for the REST server.
ErrMetricsStart is returned when an error occurs the Metrics server.
ErrRESTStart is returned when an error occurs the REST server.

# Structs

Config contains configuration options for a Server.
GRPC is a listening grpc server instance.
GRPCRest is a listening grpc rest server instance.
Information holds app version info.
Metrics is a listening HTTP collector server instance.
REST is a listening HTTP server instance.
Server is a listening server instance.

# Interfaces

GRPCObserver interface implemented by anything wants to append observer in the server thro UnaryServerInterceptor and StreamServerInterceptor.
GRPCRegisterService is an interface for a grpc service that provides registration.
GRPCRestRegisterService is an interface for a grpc rest service that provides registration.

# Type aliases

GRPCRegisterServiceFunc is the function to register service to a grpc.
Option sets up a server.