internal

package
v0.0.0-...-7f9e59b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHawkAuthMethods

func CheckHawkAuthMethods(r *http.Request) bool

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.

func InitConfig

func InitConfig(version string) Config

InitConfig initialize the configuration

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL