server

package
v0.0.0-...-d4ca7bd Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(srvConfig *Config)

Run will execute the server process with the provided config Reference: https://github.com/gorilla/mux#graceful-shutdown

Types

type Config

type Config struct {
	Domain         string
	Port           string
	Handler        http.Handler
	WriteTimeout   time.Duration
	ReadTimeout    time.Duration
	IdleTimeout    time.Duration
	DefaultTimeout time.Duration
}

Config reprsents the configuration needed for the server

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig will create a default server configuration

func (*Config) UpdateDefaultTimeout

func (s *Config) UpdateDefaultTimeout(d time.Duration)

UpdateDefaultTimeout will update the default timeout

func (*Config) UpdateHandler

func (s *Config) UpdateHandler(h http.Handler)

UpdateHandler will update the HTTP handler

func (*Config) UpdateIdleTimeout

func (s *Config) UpdateIdleTimeout(d time.Duration)

UpdateWriteTimeout will update the idle timeout

func (*Config) UpdatePort

func (s *Config) UpdatePort(port string)

UpdatePort will update the port

func (*Config) UpdateReadTimeout

func (s *Config) UpdateReadTimeout(d time.Duration)

UpdateWriteTimeout will update the read timeout

func (*Config) UpdateWriteTimeout

func (s *Config) UpdateWriteTimeout(d time.Duration)

UpdateWriteTimeout will update the write timeout

Jump to

Keyboard shortcuts

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