config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RouteTypes is an array of the available route types
	RouteTypes []RouteType = []RouteType{QueryRoute, RegexRoute, PrefixRoute}
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Path string
}

Asset defines the available asset configuration.

type Config

type Config struct {
	File     string
	Log      Log
	Debug    Debug
	HTTP     HTTP
	Tracing  Tracing
	Asset    Asset
	Policies []Policy
}

Config combines all available configuration parts.

func New

func New() *Config

New initializes a new configuration

type Debug

type Debug struct {
	Addr   string
	Token  string
	Pprof  bool
	Zpages bool
}

Debug defines the available debug configuration.

type HTTP

type HTTP struct {
	Addr      string
	Namespace string
	Root      string
	TLSCert   string
	TLSKey    string
}

HTTP defines the available http configuration.

type Log

type Log struct {
	Level  string
	Pretty bool
	Color  bool
}

Log defines the available logging configuration.

type Policy

type Policy struct {
	Name   string
	Routes []Route
}

Policy enables us to use multiple directors.

type Route

type Route struct {
	Type        RouteType
	Endpoint    string
	Backend     string
	ApacheVHost bool `mapstructure:"apache-vhost"`
}

Route define forwarding routes

type RouteType added in v0.2.0

type RouteType string

RouteType defines the type of a route

const (
	// PrefixRoute are routes matched by a prefix
	PrefixRoute RouteType = "prefix"
	// QueryRoute are routes machted by a prefix and query parameters
	QueryRoute RouteType = "query"
	// RegexRoute are routes matched by a pattern
	RegexRoute RouteType = "regex"
	// DefaultRouteType is the PrefixRoute
	DefaultRouteType RouteType = PrefixRoute
)

type Tracing

type Tracing struct {
	Enabled   bool
	Type      string
	Endpoint  string
	Collector string
	Service   string
}

Tracing defines the available tracing configuration.

Jump to

Keyboard shortcuts

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