Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface { Flush() error ListenAndServe() error ServeHTTP(w http.ResponseWriter, r *http.Request) }
func NewServer ¶
func NewServer(options ...ServerOptionFunc) (Server, error)
type ServerOptionFunc ¶
type ServerOptionFunc func(*server) error
ServerOptionFunc is a function that configures a Server. It is used in NewServer.
func SetBuildInfo ¶
func SetBuildInfo(info *c.BuildVersionInfo) ServerOptionFunc
SetBuildInfo adds a version handler for showing build information at '/version'.
func SetIntroSpection ¶
func SetIntroSpection(enabled bool) ServerOptionFunc
SetIntroSpection enables introspection handlers.
func SetPort ¶
func SetPort(port int) ServerOptionFunc
SetPort sets the port on which the server will listen to TCP traffic.
func SetRouters ¶
func SetRouters(rb ...RouterCallBack) ServerOptionFunc
SetRouters adds all HTTP routes for the server.
func SetStaticAssets ¶
func SetStaticAssets(assets http.FileSystem) ServerOptionFunc
SetStaticAssets registers static assets to be used as middleware.
Directories ¶
Path | Synopsis |
---|---|
assets.FileSystem can be used as any other http.FileSystem in your program, for example http.Handle("/assets", http.FileServer(assets.FileSystem)) You must run 'go generate ./...' to update the contents of the assets.
|
assets.FileSystem can be used as any other http.FileSystem in your program, for example http.Handle("/assets", http.FileServer(assets.FileSystem)) You must run 'go generate ./...' to update the contents of the assets. |
Click to show internal directories.
Click to hide internal directories.