Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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) AddContentDecoder ¶
func (a Application) AddContentDecoder(token string, decoder encodings.Decoder)
AddContentDecoder simply adds a new content decoder
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) Shutdown ¶
func (a Application) Shutdown()
Shutdown gracefully shutting down the server. It is not blocking, server being shut down right after calling this method is not guaranteed, because tcp server will wait for the next connection, and only then he'll be able to receive a shutdown notify. Moreover, tcp server will wait until all the existing connections will be closed