server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHTTP added in v0.0.2

func WithHTTP(port string) func(*Server)

WithHTTP creates server with port

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 WithListener added in v0.0.2

func WithListener(listener net.Listener) func(*Server)

WithListener creates server with custom listener

func WithSSL added in v0.0.2

func WithSSL(port, certFile, keyFile string) func(*Server)

WithSSL creates server with SSL port and certificate/key files

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(
	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