server

package
v2.17.5 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: CC0-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeHTTP

func ServeHTTP(config *Config) error

func ServeHTTPS

func ServeHTTPS(config *Config) error

func WaitTermSig

func WaitTermSig(ctx context.Context, handler func(context.Context) error) <-chan struct{}

Types

type Config

type Config struct {
	Port          int    `yaml:"port"`
	ReadTimeout   int    `yaml:"read_timeout"`
	WriteTimeout  int    `yaml:"write_timeout"`
	MaxHeaderByte int    `yaml:"max_header_byte"`
	Environment   string `yaml:"environment"`
	Handler       http.Handler
	CertFile      string
	KeyFile       string
	EncryptionKey string `yaml:"encryption_key"`
	Ctx           context.Context
}

type GRPC

type GRPC interface {
	GracefulStop()
	Stop()
	Serve(l net.Listener) error
}

GRPC represents interface for grpc server

type HTTP

type HTTP interface {
	Shutdown(ctx context.Context) error
	ListenAndServer() error
	ListenAndServerTLS(certFile, keyFile string) error
}

HTTP represents interface for HTTP/s server

Jump to

Keyboard shortcuts

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