Documentation ¶
Index ¶
- Constants
- type App
- func (a *App) AutoHTTPS(addr string, domains ...string) *App
- func (a *App) GracefulStop()
- func (a *App) HTTPS(addr string, cert, key string) *App
- func (a *App) Listen(addr string, optListener ...Listener) *App
- func (a *App) OnBind(cb func(addr string)) *App
- func (a *App) OnStart(cb func()) *App
- func (a *App) OnStop(cb func()) *App
- func (a *App) Serve(r router.Fabric) error
- func (a *App) Stop()
- func (a *App) Tune(cfg config.Config) *App
- type Listener
Constants ¶
const Version = "v0.16.3"
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) OnBind ¶ added in v0.16.0
OnBind calls the passed callback for every address, that was bound without any errors
func (*App) OnStart ¶ added in v0.16.0
OnStart 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) OnStop ¶ added in v0.16.0
OnStop 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.