server

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapAllowedLevels = map[string][]string{
	"DEBUG": {"INFO", "DEBUG", "WARN", "ERROR"},
	"ERROR": {"ERROR"},
	"INFO":  {"INFO", "WARN", "ERROR"},
	"WARN":  {"WARN", "ERROR"},
}

MapAllowedLevels allows to map a given level to a list of allowed level. Convention taken from go-kit/level v0.10.0 https://godoc.org/github.com/go-kit/kit/log/level#AllowAll.

Functions

func DefaultCodeToLevelGRPC

func DefaultCodeToLevelGRPC(c codes.Code) grpc_logging.Level

DefaultCodeToLevelGRPC is the helper mapper that maps gRPC Response codes to log levels.

Types

type Registerable

type Registerable interface {
	Register(ctx context.Context, srv *grpc.Server, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error
}

type RegisterableFunc

type RegisterableFunc func(ctx context.Context, srv *grpc.Server, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error

func (RegisterableFunc) Register

func (f RegisterableFunc) Register(ctx context.Context, srv *grpc.Server, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error

type Server

type Server struct {
	http.Server
	// contains filtered or unexported fields
}

Server is a wrapper around the http.Server

func NewServer

func NewServer(reg *prometheus.Registry) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, logger log.Logger, port string, allowedCORSOrigins []string, registerables ...Registerable) error

ListenAndServe starts the http grpc gateway server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown the server

Jump to

Keyboard shortcuts

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