Documentation ¶
Index ¶
- Constants
- 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 ¶
const Version = "v0.15.9"
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, but keeps serving old ones.
NOTE: the call isn't blocking. So by that, after the method returned, the server will be still working
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.
NOTE: the call isn't blocking. So by that, after the method returned, the server will still be working
type Listener ¶ added in v0.15.0
type Listener struct { Port uint16 Constructor ListenerConstructor Encryption encryption.Encryption }