config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EvalContentTypeVar = EvalVarPrefix + "CONTENTTYPE"

EvalContentTypeVar ...

View Source
const EvalCookieVar = EvalVarPrefix + "COOKIE"

EvalCookieVar ...

View Source
const EvalHostVar = EvalVarPrefix + "HOST"

EvalHostVar ...

View Source
const EvalMethodVar = EvalVarPrefix + "METHOD"

EvalMethodVar ...

View Source
const EvalPathVar = EvalVarPrefix + "PATH"

EvalPathVar ...

View Source
const EvalReqHeaderVar = EvalVarPrefix + "REQHEADER"

EvalReqHeaderVar ...

View Source
const EvalRespHeaderVar = EvalVarPrefix + "RESPHEADER"

EvalRespHeaderVar ...

View Source
const EvalStatusCodeVar = EvalVarPrefix + "STATUSCODE"

EvalStatusCodeVar ...

View Source
const EvalVarPrefix = "Krat"

EvalVarPrefix ...

Variables

View Source
var ConfigCookieVarRegex = regexp.MustCompile("\\$\\(cookie::([a-zA-Z0-9\\-\\_]+)\\)")

ConfigCookieVarRegex ...

View Source
var ConfigReqHeaderVarRegex = regexp.MustCompile("\\$\\(req\\.header::([a-zA-Z0-9\\-\\_]+)\\)")

ConfigReqHeaderVarRegex ...

View Source
var ConfigRespHeaderVarRegex = regexp.MustCompile("\\$\\(resp\\.header::([a-zA-Z0-9\\-\\_]+)\\)")

ConfigRespHeaderVarRegex ...

View Source
var ConfigVarRegex = regexp.MustCompile("\\$\\([a-zA-Z0-9\\-:\\.\\_]+\\)")

ConfigVarRegex ...

Functions

func GetEvalParamName

func GetEvalParamName(k string) string

GetEvalParamName ...

func ParseConfigKeys

func ParseConfigKeys(s string) (string, string, string)

ParseConfigKeys ...

Types

type Admin

type Admin struct {
	Addr string `yaml:"addr"`
}

Admin ...

type Cache

type Cache struct {
	TTL              int `yaml:"ttl"`
	CleanFrequency   int `yaml:"cleanFrequency"`
	MaxEntries       int `yaml:"maxEntries"`
	MaxEntrySize     int `yaml:"maxEntrySize"`
	HardMaxCacheSize int `yaml:"hardMaxCacheSize"`
}

Cache ...

type Config

type Config struct {
	Cache       Cache       `yaml:"cache"`
	Invalidator Invalidator `yaml:"invalidator"`
	Proxy       Proxy       `yaml:"proxy"`
	Admin       Admin       `yaml:"admin"`

	LogLevel  string `yaml:"logLevel"`
	LogOutput string `yaml:"logOutput"`
}

Config ...

func Parse

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

Parse ...

type Header struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
	When  string `yaml:"if"`
}

Header ...

type Invalidator

type Invalidator struct {
	MaxWorkers int32 `yaml:"maxWorkers"`
}

Invalidator ...

type Proxy

type Proxy struct {
	Addr         string        `yaml:"addr"`
	BackendAddrs []string      `yaml:"backendAddrs"`
	Response     ProxyResponse `yaml:"response"`
	Nocache      []string      `yaml:"nocache"`
}

Proxy ...

type ProxyResponse

type ProxyResponse struct {
	Headers ProxyResponseHeaders `yaml:"headers"`
}

ProxyResponse ...

type ProxyResponseHeaders

type ProxyResponseHeaders struct {
	Set   []Header `yaml:"set"`
	Unset []Header `yaml:"unset"`
}

ProxyResponseHeaders ...

Jump to

Keyboard shortcuts

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