Documentation ¶
Overview ¶
Package httpeasy package is intended for quick web service development.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapt ¶ added in v0.4.7
func Adapt(next httprouter.Handle, adapters ...Adapter) httprouter.Handle
Adapt composes handlers chain end executes it.
Types ¶
type Adapter ¶ added in v0.4.7
type Adapter func(httprouter.Handle) httprouter.Handle
type Config ¶
type Config struct { ProductionMode bool `env:"PROD"` SSL SSL `validate:"required_if=ProductionMode true"` Port uint16 `env:"PORT" validate:"min=80,max=65535"` ReadTimeout time.Duration `env:"READ_TIMEOUT" default:"1m"` ReadHeaderTimeout time.Duration `env:"READ_HEADER_TIMEOUT" default:"15s"` WriteTimeout time.Duration `env:"WRITE_TIMEOUT" default:"1m"` // contains filtered or unexported fields }
Config - http service configuration compatible to settings package. https://github.com/kaatinga/settings
func NewConfig ¶
func NewConfig() *Config
NewConfig creates new config model that later can be processed by settings package or updated manually.
func (*Config) Launch ¶
func (config *Config) Launch(handlers SetUpHandlers) error
Launch enables the configured web service with the handlers that announced in a function matched with SetUpHandlers type.
type SetUpHandlers ¶
type SetUpHandlers func(r *httprouter.Router)
SetUpHandlers type to announce handlers.
Click to show internal directories.
Click to hide internal directories.