config

package
v0.0.0-...-19a0cb6 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFileName string = "tlsrproxy"

ConfigFileName is the default config for the rewriting proxy.

Functions

func SetConf

func SetConf(c *Conf) error

SetConf is used mainly in unit tests.

Types

type Body

type Body PairList

func (*Body) Flattern

func (b *Body) Flattern() []string

type Conf

type Conf struct {
	Server Server
	Proxy  Proxy
}

func GetConf

func GetConf() (*Conf, error)

GetConf returns the global vper object

type Headers

type Headers PairList

func (*Headers) Flatttern

func (h *Headers) Flatttern() []string

type PairList

type PairList [][]string

type Proxy

type Proxy struct {
	Upstream string   `mapstructure:"upstream"`
	Mimes    []string `mapstructure:"mimes"`
	Replaces Replaces
}

type Replaces

type Replaces struct {
	Request Request
	Response
}

type Request

type Request struct {
	Headers Headers
}

type Response

type Response struct {
	Headers Headers  `mapstructure:"headers"`
	Body    Body     `mapstructure:"body"`
	Mimes   []string `mapstructure:"mimes"`
}

type Server

type Server struct {
	HTTPAddr string `mapstructure:"http_addr"`
	Cert     string `mapstructure:"cert"`
	Key      string `mapstructure:"key"`
	Drain    string `mapstructure:"drain"`
}

Jump to

Keyboard shortcuts

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