server

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port            int           `mapstructure:"port" description:"port of the server"`
	Timeout         time.Duration `mapstructure:"request_timeout" description:"read and write timeout duration for requests"`
	ShutdownTimeout time.Duration `mapstructure:"shutdown_timeout" description:"time to wait for the server to shutdown"`
	RootAPI         string        `mapstructure:"root_api" description:"the root api used for all other subroutes"`
	SelfURL         string        `mapstructure:"self_url" description:"an externally accessible url pointing to this server's fully qualified root address'"`
}

Settings type to be loaded from the environment

func DefaultConfig

func DefaultConfig() *Config

DefaultSettings returns the default values for configuring the System Broker

func (*Config) Validate

func (s *Config) Validate() error

Validate validates the server settings

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

func New

func New(c *Config, middlewares []mux.MiddlewareFunc, routesProvider ...func(router *mux.Router)) *Server

func NewServerWithRouter

func NewServerWithRouter(c *Config, router *mux.Router) *Server

func (*Server) Start

func (s *Server) Start(parentCtx context.Context, wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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