server

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 17 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 WithSSL added in v0.0.2

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

WithSSL creates server with SSL port and certificate/key files

func WithTLSConfig

func WithTLSConfig(port string, tlsConfig *tls.Config) func(*Server)

WithTLSConfig creates server with SSL port and tls config

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.IService,
	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

type Validator added in v0.0.3

type Validator interface {
	Validate() error
}

Validator is request validator interface

Jump to

Keyboard shortcuts

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