Documentation ¶
Index ¶
- type AccessLogger
- type Context
- type ContextHandler
- type MicroService
- func (m *MicroService) Handle(method string, path string, handler ContextHandler)
- func (ms *MicroService) NotAllowed(method string, path string)
- func (m *MicroService) Principal(method string, path string, handler ContextHandler)
- func (ms *MicroService) Start()
- func (ms *MicroService) StartOnPort(port int)
- type Principal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLogger ¶
type AccessLogger struct {
// contains filtered or unexported fields
}
* Handle principal calls
func (AccessLogger) ServeHTTP ¶
func (p AccessLogger) ServeHTTP(w http.ResponseWriter, r *http.Request, c *Context)
Wrap the request with access logging
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
type ContextHandler ¶
type ContextHandler func(http.ResponseWriter, *http.Request, *Context)
type MicroService ¶
type MicroService struct { Health func(w http.ResponseWriter, r *http.Request, c *Context) // contains filtered or unexported fields }
func (*MicroService) Handle ¶
func (m *MicroService) Handle(method string, path string, handler ContextHandler)
Wrap a Handler with AccessLogger and Principal
func (*MicroService) NotAllowed ¶
func (ms *MicroService) NotAllowed(method string, path string)
Handle: Not Allowed Requests
func (*MicroService) Principal ¶
func (m *MicroService) Principal(method string, path string, handler ContextHandler)
Wrap a Handler with AccessLogger and Principal
func (*MicroService) Start ¶
func (ms *MicroService) Start()
Start a microservice with default health page. It uses port 8080 by convention.
func (*MicroService) StartOnPort ¶
func (ms *MicroService) StartOnPort(port int)
Start a microservice with default health page on the given port
Click to show internal directories.
Click to hide internal directories.