server

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: CC0-1.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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