Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeyAuthID returns the context Value of the Auth set by the defaultAuthMiddleware func on successful auth KeyAuthID key = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCallback ¶
AuthCallback is the function called when doing bearer authentication
type Controller ¶
type Controller struct { AuthCallback AuthCallback // contains filtered or unexported fields }
Controller runs the controller
func NewController ¶
func NewController() *Controller
NewController creates a new HTTP API controller
func (*Controller) AddHandler ¶
func (c *Controller) AddHandler(path string, fn HTTPHandler, methods ...string)
AddHandler adds a handler
func (*Controller) Run ¶
func (c *Controller) Run(addr string)
Run runs the controller and the listener
type HTTPHandler ¶
type HTTPHandler func(w http.ResponseWriter, r *http.Request)
HTTPHandler is the handler that is called when path is accessed
Click to show internal directories.
Click to hide internal directories.