Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHawkAuthMethods ¶
CheckHawkAuthMethods validates a HTTP request, returning true if it's good.
Current methods:
* Hawk attrd cookie * Basic Auth (user/passwd)
Future methods?
* API key?
func NewRouteHandler ¶
func NewRouteHandler(config *Config) *routeHandler
NewRoutehandler creates a routeHandler object from a configuration
Types ¶
type Config ¶
type Config struct { Listen string `json:"listen"` Port int `json:"port"` Key string `json:"key"` Cert string `json:"cert"` LogLevel string `json:"loglevel"` Route []ConfigRoute `json:"route"` }
Config is the internal representation of the configuration file.
type ConfigRoute ¶
type ConfigRoute struct { Handler string `json:"handler"` Path string `json:"path"` Target *string `json:"target"` }
ConfigRoute is used in the configuration to map routes to handlers.
Possible handlers (this list may be outdated)a:
- `api/v1` - Exposes a CIB API endpoint.
- `monitor` - Typically mapped to `/monitor` to handle long-polling for CIB updates.
- `file` - A static file serving route mapped to a directory.
- `proxy` - Proxies requests to another server.
Click to show internal directories.
Click to hide internal directories.