server

package
v0.0.0-...-53677e4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIPAddress = errors.New(
		"invalid IP address")
)

Errors

Functions

This section is empty.

Types

type CloseCallback

type CloseCallback func(error)

CloseCallback will be called when the server has closed

type HandlerBuilder

type HandlerBuilder func(
	commonCfg configuration.Common,
	cfg configuration.Server,
	logger log.Logger) http.Handler

HandlerBuilder builds a HTTP handler

type HandlerBuilderBuilder

type HandlerBuilderBuilder func(command.Commands) HandlerBuilder

HandlerBuilderBuilder builds HandlerBuilder

type Server

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

Server represents a server

func New

func New(logger log.Logger) Server

New creates a new Server builder

func (Server) Serve

func (s Server) Serve(
	commonCfg configuration.Common,
	serverCfg configuration.Server,
	closeCallback CloseCallback,
	handlerBuilder HandlerBuilder,
) *Serving

Serve starts serving

func (Server) Wait

func (s Server) Wait()

Wait waits until all server is closed

type Serving

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

Serving represents a server that is serving for requests

func (*Serving) Close

func (s *Serving) Close() error

Close close the server

Jump to

Keyboard shortcuts

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