Documentation ¶
Index ¶
- Variables
- type Application
- func (a *Application) AddCoding(constructor coding.Constructor)
- func (a *Application) AddDefaultHeader(key string, values ...string)
- func (a *Application) DeleteDefaultHeader(key string)
- func (a *Application) GracefulShutdown()
- func (a *Application) Serve(r router.Router, optionalSettings ...settings.Settings) error
- func (a *Application) SetDefaultHeaders(headers map[string][]string)
- func (a *Application) Stop()
Constants ¶
This section is empty.
Variables ¶
var DefaultHeaders = map[string][]string{ "Accept-Encodings": nil, }
DefaultHeaders are headers that are going to be sent unless they were overridden by user.
WARNING: if you want to edit them, do it using Application.AddDefaultHeader or Application.DeleteDefaultHeader instead
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is just a struct with addr and shutdown channel that is currently not used. Planning to replace it with context.WithCancel()
func NewApp ¶
func NewApp(addr string) *Application
NewApp returns a new application object with initialized shutdown chan
func (*Application) AddCoding ¶ added in v0.10.4
func (a *Application) AddCoding(constructor coding.Constructor)
AddCoding adds a new content coding, available for both encoding and decoding
func (*Application) AddDefaultHeader ¶
func (a *Application) AddDefaultHeader(key string, values ...string)
func (*Application) DeleteDefaultHeader ¶
func (a *Application) DeleteDefaultHeader(key string)
func (*Application) GracefulShutdown ¶ added in v0.10.1
func (a *Application) GracefulShutdown()
GracefulShutdown stops the application peacefully. It stops a listener, so no more clients will be able to connect, but all the already connected will be processed till end (till the last one disconnects)
func (*Application) Serve ¶
Serve takes a router and someSettings, that must be only 0 or 1 elements otherwise, error is returned Also, if specified, Accept-Encodings default header's value will be set here
func (*Application) SetDefaultHeaders ¶
func (a *Application) SetDefaultHeaders(headers map[string][]string)
SetDefaultHeaders overrides default headers to a passed ones. Doing this, make sure you know what are you doing
func (*Application) Stop ¶ added in v0.10.1
func (a *Application) Stop()