traefik

package
v0.0.0-...-1391df3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

Aggregator represents traefik response model

func NewAggregator

func NewAggregator(traefikURL string, traefikV2, containerBased, usePathPrefix bool, timeout time.Duration) *Aggregator

NewAggregator creates new traefik aggregator

func (*Aggregator) AggregateHealth

func (a *Aggregator) AggregateHealth() map[string]interface{}

AggregateHealth aggregates health info

func (*Aggregator) AggregateInfo

func (a *Aggregator) AggregateInfo() map[string]interface{}

AggregateInfo aggregates info

type Backend

type Backend struct {
	Servers map[string]*Server `json:"servers,omitempty"`
}

Backend represents traefik response model

type Cookie struct {
	Name     string `json:"name,omitempty"     toml:"name,omitempty"     yaml:"name,omitempty"`
	Secure   bool   `json:"secure,omitempty"   toml:"secure,omitempty"   yaml:"secure,omitempty"`
	HTTPOnly bool   `json:"httpOnly,omitempty" toml:"httpOnly,omitempty" yaml:"httpOnly,omitempty"`
}

Cookie holds the sticky configuration based on cookie.

type HealthCheck

type HealthCheck struct {
	Scheme   string            `json:"scheme,omitempty"   toml:"scheme,omitempty"        yaml:"scheme,omitempty"`
	Path     string            `json:"path,omitempty"     toml:"path,omitempty"          yaml:"path,omitempty"`
	Port     int               `json:"port,omitempty"     toml:"port,omitempty,omitzero" yaml:"port,omitempty"`
	Interval string            `json:"interval,omitempty" toml:"interval,omitempty"      yaml:"interval,omitempty"`
	Timeout  string            `json:"timeout,omitempty"  toml:"timeout,omitempty"       yaml:"timeout,omitempty"`
	Hostname string            `json:"hostname,omitempty" toml:"hostname,omitempty"      yaml:"hostname,omitempty"`
	Headers  map[string]string `json:"headers,omitempty"  toml:"headers,omitempty"       yaml:"headers,omitempty"`
}

HealthCheck holds the HealthCheck configuration.

type LocalProvider

type LocalProvider struct {
	Provider Provider `json:"file,omitempty"`
}

LocalProvider represents traefik v1.* with local installation response model

type MirrorService

type MirrorService struct {
	Name    string `json:"name,omitempty"    toml:"name,omitempty"    yaml:"name,omitempty"`
	Percent int    `json:"percent,omitempty" toml:"percent,omitempty" yaml:"percent,omitempty"`
}

MirrorService holds the MirrorService configuration.

type Mirroring

type Mirroring struct {
	Service string          `json:"service,omitempty" toml:"service,omitempty" yaml:"service,omitempty"`
	Mirrors []MirrorService `json:"mirrors,omitempty" toml:"mirrors,omitempty" yaml:"mirrors,omitempty"`
}

Mirroring holds the Mirroring configuration.

type NodeInfo

type NodeInfo struct {
	URL string
}

NodeInfo embeds node-related information

func (*NodeInfo) GetHealthEndpoint

func (ni *NodeInfo) GetHealthEndpoint() string

GetHealthEndpoint returns health check URL

func (*NodeInfo) GetInfoEndpoint

func (ni *NodeInfo) GetInfoEndpoint() string

GetInfoEndpoint returns info endpoint URL

type Provider

type Provider struct {
	Backends map[string]*Backend `json:"backends,omitempty"`
}

Provider represents traefik response model

type Providers

type Providers struct {
	Docker *Provider `json:"docker,omitempty"`
}

Providers represents traefik response model

type RawData

type RawData struct {
	Routers  map[string]Router      `json:"routers,omitempty"`
	Services map[string]ServiceInfo `json:"services,omitempty"`
}

type Router

type Router struct {
	Service string   `json:"service,omitempty"`
	Rule    string   `json:"rule,omitempty"`
	Status  string   `json:"status,omitempty"`
	Using   []string `json:"using,omitempty"`
}

type Server

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

Server represents traefik response model

type ServersLoadBalancer

type ServersLoadBalancer struct {
	Servers     []Server     `json:"servers,omitempty"`
	HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
}

ServersLoadBalancer holds the ServersLoadBalancer configuration.

type ServiceInfo

type ServiceInfo struct {
	LoadBalancer *ServersLoadBalancer `json:"loadBalancer,omitempty" label:"-" toml:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"`
	Weighted     *WeightedRoundRobin  `json:"weighted,omitempty"     label:"-" toml:"weighted,omitempty"     yaml:"weighted,omitempty"`
	Mirroring    *Mirroring           `json:"mirroring,omitempty"    label:"-" toml:"mirroring,omitempty"    yaml:"mirroring,omitempty"`

	// Err contains all the errors that occurred during service creation.
	Err []string `json:"error,omitempty"`
	// Status reports whether the service is disabled, in a warning state, or all good (enabled).
	// If not in "enabled" state, the reason for it should be in the list of Err.
	// It is the caller's responsibility to set the initial status.
	Status       string            `json:"status,omitempty"`
	UsedBy       []string          `json:"usedBy,omitempty"` // list of routers using that service
	ServerStatus map[string]string `json:"serverStatus,omitempty"`
}

ServiceInfo holds information about a currently running service.

type Sticky

type Sticky struct {
	Cookie *Cookie `json:"cookie,omitempty" toml:"cookie,omitempty" yaml:"cookie,omitempty"`
}

Sticky holds the sticky configuration.

type WRRService

type WRRService struct {
	Name   string `json:"name,omitempty"   toml:"name,omitempty"   yaml:"name,omitempty"`
	Weight *int   `json:"weight,omitempty" toml:"weight,omitempty" yaml:"weight,omitempty"`
}

WRRService is a reference to a service load-balanced with weighted round robin.

type WeightedRoundRobin

type WeightedRoundRobin struct {
	Services []WRRService `json:"services,omitempty" toml:"services,omitempty" yaml:"services,omitempty"`
	Sticky   *Sticky      `json:"sticky,omitempty"   toml:"sticky,omitempty"   yaml:"sticky,omitempty"`
}

WeightedRoundRobin is a weighted round robin load-balancer of services.

Jump to

Keyboard shortcuts

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