Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "proto"

Name is the name registered for the proto compressor.

Variables

This section is empty.

Functions

func DefaultCodeToLevelGRPC

func DefaultCodeToLevelGRPC(c codes.Code) grpc_logging.Level

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

func InterceptorLogger added in v0.18.0

func InterceptorLogger(l log.Logger) grpc_logging.Logger

InterceptorLogger adapts go-kit logger to interceptor logger.

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, version string) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(
	ctx context.Context,
	logger log.Logger,
	uiFS fs.FS,
	addr string,
	readTimeout time.Duration,
	writeTimeout time.Duration,
	allowedCORSOrigins []string,
	pathPrefix 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