Version: v0.20.9 Latest Latest

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

Go to latest
Published: Aug 22, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 11 Imported by: 3



Package server contains the logic of the Service Manager server and a mux router



This section is empty.


This section is empty.


This section is empty.


type Server

type Server struct {

	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 Returns the new server and an error if creation was not successful

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 {
	Host               string        `mapstructure:"host" description:"host of the server"`
	Port               int           `mapstructure:"port" description:"port of the server"`
	ProvisionTimeout   time.Duration `mapstructure:"provision_timeout" description:"timeout duration for provision requests"`
	RequestTimeout     time.Duration `mapstructure:"request_timeout" description:"read and write timeout duration for requests"`
	LongRequestTimeout time.Duration `mapstructure:"long_request_timeout" description:"read and write timeout duration for patch service-broker requests"`
	ShutdownTimeout    time.Duration `mapstructure:"shutdown_timeout" description:"time to wait for the server to shutdown"`
	MaxBodyBytes       int           `mapstructure:"max_body_bytes" description:"maximum bytes size of incoming body"`
	MaxHeaderBytes     int           `mapstructure:"max_header_bytes" description:"the maximum number of bytes the server will read parsing the request header"`

Settings type to be loaded from the environment

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings returns the default values for configuring the Service Manager

func (*Settings) Validate

func (s *Settings) Validate() error

Validate validates the server settings

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL