micro/app
app
provides an HTTP server.
Documentation
package app // import "bitbucket.org/_mikey/micro/app"
Package app provides an HTTP server
TYPES
type App struct {
*http.Server
// Has unexported fields.
}
App defines the base application
func New(cfg Config) *App
New returns a new *App
func (app *App) Run() (err error)
Run starts an HTTP server
func (app *App) RunTLS(certFile, keyFile string) (err error)
RunTLS starts an HTTPS server
type Config struct {
Addr string
Handler http.Handler
ErrorLog *log.Logger
TLSConfig *tls.Config
}
Config defines the server configuration
Tests
go test -v -test.count 5
=== RUN TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
=== RUN TestNewAppAndRun
--- PASS: TestNewAppAndRun (0.00s)
PASS
ok bitbucket.org/_mikey/micro/app 0.005s