Documentation
¶
Overview ¶
Package server implements a web server
Index ¶
- func ListenAll(s ...*Server) error
- type Options
- type Server
- func (server *Server) AddHandler(pattern string, handler http.Handler)
- func (server *Server) AddHandlerFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (server *Server) AddPage(p *page.Page) error
- func (server *Server) AddPages(p ...*page.Page) error
- func (server *Server) Address() string
- func (server *Server) Close() error
- func (server *Server) ID() string
- func (server *Server) Listen() error
- func (server *Server) PathRoot() string
- func (server *Server) Routes() []route.Route
- func (server *Server) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// ID of the server
ID string
// Address of the server
Address string
// PathPrefix holds HTTP path prefix
PathPrefix string
}
Options represents the options than can be set when creating a new server
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a web server
func (*Server) AddHandler ¶
AddHandler adds a handler
func (*Server) AddHandlerFunc ¶
func (server *Server) AddHandlerFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
AddHandlerFunc adds a handler function
Click to show internal directories.
Click to hide internal directories.