server

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: CC0-1.0 Imports: 10 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(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
}

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