server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHandlerAdapter

func WithHandlerAdapter(handlerAdapter func(http.Handler) http.Handler) func(*Server)

WithHandlerAdapter creates server with handler wrapper function (used by Let's encrypt certificate manager)

func WithSSLFile

func WithSSLFile(certFile, keyFile string) func(*Server)

WithSSLFile creates server with SSL and certificate/key files

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) func(*Server)

WithTLSConfig creates server with TLS configuration

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory is server factory

func NewFactory

func NewFactory(
	processService *service.Service,
	backupService backup.IBackup,
) *Factory

NewFactory returns server factory

func (*Factory) Build

func (f *Factory) Build(sConf config.StartupConfig) ([]*Server, error)

Build creates http/https server(s) based on startup configuration

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents http or https server

func New

func New(
	port string,
	processService *service.Service,
	backupService backup.IBackup,
	options ...func(*Server),
) *Server

New creates a new http or https server

func (*Server) Serve

func (s *Server) Serve() error

Serve start http or https server and blocks

func (*Server) Shutdown

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

Shutdown gracefully shutdowns the http server

Jump to

Keyboard shortcuts

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