config

package
v0.0.0-...-90f6e77 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Name         string               `hcl:"name,label"`
	ReverseProxy *BackendReverseProxy `hcl:"reverse_proxy,block"`
	FileServer   *BackendFileServer   `hcl:"file_server,block"`
	Prometheus   *BackendPrometheus   `hcl:"prometheus,block"`
}

type BackendFileServer

type BackendFileServer struct {
	Root string `hcl:"root"`
}

type BackendPrometheus

type BackendPrometheus struct{}

type BackendReverseProxy

type BackendReverseProxy struct {
	Targets []string `hcl:"targets"`
}

type Config

type Config struct {
	Frontends []Frontend `hcl:"frontend,block"`
	Backends  []Backend  `hcl:"backend,block"`
}

func Load

func Load(path string) (*Config, error)

type FieldMatcher

type FieldMatcher struct {
	Field string `hcl:"field,label"`

	Eq     string `hcl:"is,optional"`
	Prefix string `hcl:"has_prefix,optional"`
	Suffix string `hcl:"has_suffix,optional"`
	Regexp string `hcl:"matches,optional"`

	EqA     []string `hcl:"is_any,optional"`
	PrefixA []string `hcl:"has_any_prefix,optional"`
	SuffixA []string `hcl:"has_any_suffix,optional"`
	RegexpA []string `hcl:"matches_any,optional"`
}

type FieldModifier

type FieldModifier struct {
	Field string `hcl:"field,label"`

	Remove   bool   `hcl:"remove,optional"`
	SetValue string `hcl:"set,optional"`
	AddValue string `hcl:"add,optional"`
}

type Frontend

type Frontend struct {
	Name        string               `hcl:"name,label"`
	Bind        string               `hcl:"bind,optional"`
	Port        int                  `hcl:"port"`
	TLS         *FrontendTLS         `hcl:"tls,block"`
	Routes      []FrontendRoute      `hcl:"route,block"`
	Middlewares *FrontendMiddlewares `hcl:"middleware,block"`
}

type FrontendMiddlewares

type FrontendMiddlewares struct {
	ProxyHeaders *MiddlewareProxyHeaders `hcl:"proxy_headers,block"`
	Logger       *MiddlewareLogger       `hcl:"logger,block"`
}

type FrontendRoute

type FrontendRoute struct {
	Name         string                     `hcl:"name,label"`
	Backend      string                     `hcl:"backend"`
	Condition    *FrontendRouteCondition    `hcl:"match,block"`
	Modification *FrontendRouteModification `hcl:"modify,block"`
}

type FrontendRouteCondition

type FrontendRouteCondition struct {
	Headers []FieldMatcher  `hcl:"header,block"`
	Paths   []StringMatcher `hcl:"path,block"`
}

type FrontendRouteModification

type FrontendRouteModification struct {
	Headers []FieldModifier  `hcl:"header,block"`
	Paths   []StringModifier `hcl:"path,block"`
}

type FrontendTLS

type FrontendTLS struct {
	Cert string `hcl:"cert"`
	Key  string `hcl:"key"`
}

type MiddlewareLogger

type MiddlewareLogger struct{}

type MiddlewareProxyHeaders

type MiddlewareProxyHeaders struct{}

type StringMatcher

type StringMatcher struct {
	Eq     string `hcl:"is,optional"`
	Prefix string `hcl:"has_prefix,optional"`
	Suffix string `hcl:"has_suffix,optional"`
	Regexp string `hcl:"matches,optional"`

	EqA     []string `hcl:"is_any,optional"`
	PrefixA []string `hcl:"has_any_prefix,optional"`
	SuffixA []string `hcl:"has_any_suffix,optional"`
	RegexpA []string `hcl:"matches_any,optional"`
}

type StringModifier

type StringModifier struct {
	StripPrefix []string `hcl:"strip_prefix,optional"`
	StripSuffix []string `hcl:"strip_suffix,optional"`
}

Jump to

Keyboard shortcuts

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