config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VirtualHosts []VirtualHost `yaml:"hosts"`
	Htpasswd     string        `yaml:"htpasswd"`
	// contains filtered or unexported fields
}

Config represents the base configuration file

func Load

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

Load parses the YAML input s into a Config.

func LoadFile

func LoadFile(filename string) (*Config, error)

LoadFile parses the given YAML file into a Config.

func (*Config) Find

func (c *Config) Find(name string) (*VirtualHost, error)

Find particular VirtualHost configuration

func (*Config) NewBasicAuthenticator added in v0.0.3

func (c *Config) NewBasicAuthenticator() *auth.BasicAuth

type Prometheus

type Prometheus struct {
	Upstream upstream          `yaml:"upstream"`
	Matchers matchers          `yaml:"matcher,omitempty"`
	Headers  map[string]string `yaml:"headers,omitempty"`
}

Prometheus guard configuration

func (*Prometheus) URL added in v0.0.3

func (p *Prometheus) URL() *url.URL

func (*Prometheus) UpdateRequest added in v0.0.5

func (p *Prometheus) UpdateRequest(req *http.Request)

AddHeaders adds custom headers to request

type VirtualHost

type VirtualHost struct {
	Username   string     `yaml:"username"`
	Prometheus Prometheus `yaml:"prometheus,omitempty"`
}

VirtualHost is a basic configuration unit

Jump to

Keyboard shortcuts

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