server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeUntilInterrupted added in v0.5.0

func ServeUntilInterrupted()

ServeUntilInterrupted is the main module entry point that configures and starts a webserver, which runs until one of OS shutdown signals are received. The function is blocking.

Types

type Config added in v0.5.0

type Config struct {
	StaticDir string
	Address   string
}

Config holds basic web server settings

type Server added in v0.5.0

type Server struct {
	Config *Config
	Logger *log.Logger

	InterruptChan  chan os.Signal
	DefaultHeaders map[string]string
	// contains filtered or unexported fields
}

Server holds entities that can be used to control the web server

func NewConfiguredServer added in v0.5.0

func NewConfiguredServer() *Server

NewConfiguredServer returns a server initialized with settings from global config.

func (*Server) ServeUntilShutdown added in v0.5.0

func (s *Server) ServeUntilShutdown()

ServeUntilShutdown blocks until a shutdown signal is received, then shuts down the http server.

func (*Server) Shutdown added in v0.5.0

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the peer server.

func (*Server) Start added in v0.5.0

func (s *Server) Start() error

Start starts a http server and returns immediately.

Jump to

Keyboard shortcuts

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