types

package
v1.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLoadBalancerMethod = errors.New("Invalid method, using default")

ErrInvalidLoadBalancerMethod is thrown when the specified load balancing method is invalid.

Functions

func CanonicalDomain added in v1.1.0

func CanonicalDomain(domain string) string

CanonicalDomain returns a lower case domain with trim space

Types

type Auth added in v1.1.0

type Auth struct {
	Basic       *Basic
	Digest      *Digest
	HeaderField string
}

Auth holds authentication configuration (BASIC, DIGEST, users)

type Backend

type Backend struct {
	Servers        map[string]Server `json:"servers,omitempty"`
	CircuitBreaker *CircuitBreaker   `json:"circuitBreaker,omitempty"`
	LoadBalancer   *LoadBalancer     `json:"loadBalancer,omitempty"`
	MaxConn        *MaxConn          `json:"maxConn,omitempty"`
	HealthCheck    *HealthCheck      `json:"healthCheck,omitempty"`
}

Backend holds backend configuration.

type Basic added in v1.1.0

type Basic struct {
	Users `mapstructure:","`
}

Basic HTTP basic authentication

type Buckets added in v1.2.0

type Buckets []float64

Buckets holds Prometheus Buckets

func (*Buckets) Get added in v1.2.0

func (b *Buckets) Get() interface{}

Get []float64

func (*Buckets) Set added in v1.2.0

func (b *Buckets) Set(str string) error

Set adds strings elem into the the parser it splits str on "," and ";" and apply ParseFloat to string

func (*Buckets) SetValue added in v1.2.0

func (b *Buckets) SetValue(val interface{})

SetValue sets []float64 into the parser

func (*Buckets) String added in v1.2.0

func (b *Buckets) String() string

String return slice in a string

type CircuitBreaker

type CircuitBreaker struct {
	Expression string `json:"expression,omitempty"`
}

CircuitBreaker holds circuit breaker configuration.

type Cluster added in v1.1.0

type Cluster struct {
	Node  string `description:"Node name"`
	Store *Store
}

Cluster holds cluster config

type ConfigMessage

type ConfigMessage struct {
	ProviderName  string
	Configuration *Configuration
}

ConfigMessage hold configuration information exchanged between parts of traefik.

type Configuration

type Configuration struct {
	Backends  map[string]*Backend  `json:"backends,omitempty"`
	Frontends map[string]*Frontend `json:"frontends,omitempty"`
}

Configuration of a provider.

type Constraint

type Constraint struct {
	Key string
	// MustMatch is true if operator is "==" or false if operator is "!="
	MustMatch bool
	// TODO: support regex
	Regex string
}

Constraint hold a parsed constraint expresssion

func NewConstraint

func NewConstraint(exp string) (*Constraint, error)

NewConstraint receive a string and return a *Constraint, after checking syntax and parsing the constraint expression

func (*Constraint) MarshalText added in v1.1.0

func (c *Constraint) MarshalText() (text []byte, err error)

MarshalText encodes the receiver into UTF-8-encoded text and returns the result.

func (*Constraint) MatchConstraintWithAtLeastOneTag

func (c *Constraint) MatchConstraintWithAtLeastOneTag(tags []string) bool

MatchConstraintWithAtLeastOneTag tests a constraint for one single service

func (*Constraint) String

func (c *Constraint) String() string

func (*Constraint) UnmarshalText added in v1.1.0

func (c *Constraint) UnmarshalText(text []byte) error

UnmarshalText define how unmarshal in TOML parsing

type Constraints

type Constraints []*Constraint

Constraints holds a Constraint parser

func (*Constraints) Get

func (cs *Constraints) Get() interface{}

Get []*Constraint

func (*Constraints) Set

func (cs *Constraints) Set(str string) error

Set []*Constraint

func (*Constraints) SetValue

func (cs *Constraints) SetValue(val interface{})

SetValue sets []*Constraint into the parser

func (*Constraints) String

func (cs *Constraints) String() string

String returns []*Constraint in string

func (*Constraints) Type

func (cs *Constraints) Type() string

Type exports the Constraints type as a string

type Digest added in v1.1.0

type Digest struct {
	Users `mapstructure:","`
}

Digest HTTP authentication

type Frontend

type Frontend struct {
	EntryPoints    []string         `json:"entryPoints,omitempty"`
	Backend        string           `json:"backend,omitempty"`
	Routes         map[string]Route `json:"routes,omitempty"`
	PassHostHeader bool             `json:"passHostHeader,omitempty"`
	Priority       int              `json:"priority"`
}

Frontend holds frontend configuration.

type HealthCheck added in v1.2.0

type HealthCheck struct {
	URL string `json:"url,omitempty"`
}

HealthCheck holds HealthCheck configuration

type LoadBalancer

type LoadBalancer struct {
	Method string `json:"method,omitempty"`
	Sticky bool   `json:"sticky,omitempty"`
}

LoadBalancer holds load balancing configuration.

type LoadBalancerMethod

type LoadBalancerMethod uint8

LoadBalancerMethod holds the method of load balancing to use.

const (
	// Wrr (default) = Weighted Round Robin
	Wrr LoadBalancerMethod = iota
	// Drr = Dynamic Round Robin
	Drr
)

func NewLoadBalancerMethod

func NewLoadBalancerMethod(loadBalancer *LoadBalancer) (LoadBalancerMethod, error)

NewLoadBalancerMethod create a new LoadBalancerMethod from a given LoadBalancer.

type MaxConn

type MaxConn struct {
	Amount        int64  `json:"amount,omitempty"`
	ExtractorFunc string `json:"extractorFunc,omitempty"`
}

MaxConn holds maximum connection configuration

type Metrics added in v1.2.0

type Metrics struct {
	Prometheus *Prometheus `description:"Prometheus metrics exporter type"`
}

Metrics provides options to expose and send Traefik metrics to different third party monitoring systems

type Prometheus added in v1.2.0

type Prometheus struct {
	Buckets Buckets `description:"Buckets for latency metrics"`
}

Prometheus can contain specific configuration used by the Prometheus Metrics exporter

type Route

type Route struct {
	Rule string `json:"rule,omitempty"`
}

Route holds route configuration.

type Server

type Server struct {
	URL    string `json:"url,omitempty"`
	Weight int    `json:"weight"`
}

Server holds server configuration.

type Statistics added in v1.2.0

type Statistics struct {
	RecentErrors int `description:"Number of recent errors logged"`
}

Statistics provides options for monitoring request and response stats

type Store added in v1.1.0

type Store struct {
	store.Store
	Prefix string // like this "prefix" (without the /)
}

Store holds KV store cluster config

type Users added in v1.1.0

type Users []string

Users authentication users

Jump to

Keyboard shortcuts

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