Documentation ¶
Index ¶
- type App
- func (a *App) AutoHTTPS(port uint16, domains ...string) *App
- func (a *App) GracefulStop()
- func (a *App) HTTPS(port uint16, cert, key string) *App
- func (a *App) Listen(port uint16, enc encryption.Encryption, ...) *App
- func (a *App) NotifyOnStart(cb func()) *App
- func (a *App) NotifyOnStop(cb func()) *App
- func (a *App) Serve(r router.Router) error
- func (a *App) Stop()
- func (a *App) TLS(port uint16, constructor ListenerConstructor) *App
- func (a *App) Tune(s settings.Settings) *App
- type Listener
- type ListenerConstructor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.15.0
type App struct {
// contains filtered or unexported fields
}
App is just a struct with addr and shutdown channel that is currently not used. Planning to replace it with context.WithCancel()
func (*App) AutoHTTPS ¶ added in v0.15.0
AutoHTTPS enables HTTPS-mode using autocert or generates self-signed certificates if using local host
func (*App) GracefulStop ¶ added in v0.15.0
func (a *App) GracefulStop()
GracefulStop stops accepting new connections and waits until all the already connected clients disconnects
func (*App) Listen ¶ added in v0.15.0
func (a *App) Listen(port uint16, enc encryption.Encryption, optionalConstructor ...ListenerConstructor) *App
Listen adds a new listener
func (*App) NotifyOnStart ¶ added in v0.15.0
NotifyOnStart calls the callback at the moment, when all the servers are started. However, it isn't strongly guaranteed that they'll be able to accept new connections immediately
func (*App) NotifyOnStop ¶ added in v0.15.0
NotifyOnStop calls the callback at the moment, when all the servers are down. It's guaranteed, that at the moment as the callback is called, the server isn't able to accept any new connections and all the clients are already disconnected
func (*App) Serve ¶ added in v0.15.0
Serve starts the web-application. If nil is passed instead of a router, empty inbuilt will be used.
func (*App) Stop ¶ added in v0.15.0
func (a *App) Stop()
Stop stops the whole application immediately.
type Listener ¶ added in v0.15.0
type Listener struct { Port uint16 Constructor ListenerConstructor Encryption encryption.Encryption }