server

package module
v0.0.0-...-dbeddc9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(c defaultConfig) defaultConfig

func WithDefaultAddr

func WithDefaultAddr(addr string) Option

type Server

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

func (*Server) Listen

func (c *Server) Listen() error

func (*Server) ListenAndRegisterSignalHandler

func (c *Server) ListenAndRegisterSignalHandler(ctx context.Context) error

func (*Server) Shutdown

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

type ServerConfig

type ServerConfig struct {
	Address  string `toml:"address"`
	CertPath string `toml:"cert_path"`
	KeyPath  string `toml:"key_path"`
}

func (*ServerConfig) NewServer

func (c *ServerConfig) NewServer(handler http.Handler, logger zerolog.Logger) (*Server, error)

func (*ServerConfig) RegisterFlags

func (c *ServerConfig) RegisterFlags(f *flag.FlagSet, prefix string, opts ...Option)

func (*ServerConfig) UseCommonRoutes

func (c *ServerConfig) UseCommonRoutes(mux *http.ServeMux, public bool)

Jump to

Keyboard shortcuts

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