server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*mux.Router

	Config *Settings
}

Server is the server to process incoming HTTP requests

func New

func New(config *Settings, api *web.API) *Server

New creates a new server with the provided REST api configuration and server configuration

func (*Server) Run

func (s *Server) Run(ctx context.Context, wg *sync.WaitGroup)

Run starts the server awaiting for incoming requests

type Settings

type Settings struct {
	Port int `mapstructure:"port" description:"port of the server"`
}

Settings type to be loaded from the environment

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings returns the default values for configuring the server

func (*Settings) Validate

func (s *Settings) Validate() error

Validate validates the server settings

Jump to

Keyboard shortcuts

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