Documentation ¶
Overview ¶
Package server provides HTTP/2 gRCP server functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string Port string Username string Password string AppliedBearerAuthMethods []string AppliedBasicAuthMethods []string Secret []byte }
Config represents server's config.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is responsible to act as gRPC server. It composes grpc.Server.
func NewServer ¶
NewServer creates an instance of Server for used in development environment.
These are list of interceptors that are attached (from innermost to outermost):
- Metrics, using Prometheus.
- Logging, using zap logger.
- Recoverer, using grpcrecovery.
func (*Server) AttachService ¶
AttachService attaches service to gRPC server. It will be called before serve.
func (*Server) EnablePrometheus ¶
EnablePrometheus registers prometheus metrics.
func (*Server) GracefulStop ¶
func (gs *Server) GracefulStop()
GracefulStop blocks the server and wait for termination signal. The termination signal must be one of SIGINT or SIGTERM. Once it receives one of those signals, the gRPC server will perform graceful stop and close the listener.
It receives Closer and will perform all closers before closing itself.