config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Backend string
	Options map[string]interface{}
	Rules   []*CacheRule
}

type CacheRule

type CacheRule struct {
	Name       string
	Conditions []map[string]string
}

type Config

type Config struct {
	Verbose   bool
	HttpAddr  string
	ProxyAddr string
	Rewrite   *Rewrite
	Cache     *Cache
}

func LoadConfig

func LoadConfig(cfgFile string) *Config

type Rewrite

type Rewrite struct {
	Rules []*RewriteRule `validate:"dive"`
}

type RewriteRule

type RewriteRule struct {
	Pattern         string         `validate:"required"`
	CompiledPattern *regexp.Regexp `yaml:"-"`
	Replace         string         `validate:"required"`
}

Jump to

Keyboard shortcuts

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