runtime

package
v2.0.0-beta1.0...-88ebac9 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StatusEnabled  = "enabled"
	StatusDisabled = "disabled"
	StatusWarning  = "warning"
)

Status of the router/service

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Routers     map[string]*RouterInfo     `json:"routers,omitempty"`
	Middlewares map[string]*MiddlewareInfo `json:"middlewares,omitempty"`
	Services    map[string]*ServiceInfo    `json:"services,omitempty"`
	TCPRouters  map[string]*TCPRouterInfo  `json:"tcpRouters,omitempty"`
	TCPServices map[string]*TCPServiceInfo `json:"tcpServices,omitempty"`
}

Configuration holds the information about the currently running traefik instance.

func NewConfig

func NewConfig(conf dynamic.Configuration) *Configuration

NewConfig returns a Configuration initialized with the given conf. It never returns nil.

func (*Configuration) GetRoutersByEntryPoints

func (c *Configuration) GetRoutersByEntryPoints(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*RouterInfo

GetRoutersByEntryPoints returns all the http routers by entry points name and routers name

func (*Configuration) GetTCPRoutersByEntryPoints

func (c *Configuration) GetTCPRoutersByEntryPoints(ctx context.Context, entryPoints []string) map[string]map[string]*TCPRouterInfo

GetTCPRoutersByEntryPoints returns all the tcp routers by entry points name and routers name

func (*Configuration) PopulateUsedBy

func (c *Configuration) PopulateUsedBy()

PopulateUsedBy populates all the UsedBy lists of the underlying fields of r, based on the relations between the included services, routers, and middlewares.

type MiddlewareInfo

type MiddlewareInfo struct {
	*dynamic.Middleware // dynamic configuration
	// Err contains all the errors that occurred during service creation.
	Err    []string `json:"error,omitempty"`
	Status string   `json:"status,omitempty"`
	UsedBy []string `json:"usedBy,omitempty"` // list of routers and services using that middleware
}

MiddlewareInfo holds information about a currently running middleware

func (*MiddlewareInfo) AddError

func (m *MiddlewareInfo) AddError(err error, critical bool)

AddError adds err to s.Err, if it does not already exist. If critical is set, m is marked as disabled.

type RouterInfo

type RouterInfo struct {
	*dynamic.Router // dynamic configuration
	// Err contains all the errors that occurred during router's creation.
	Err []string `json:"error,omitempty"`
	// Status reports whether the router 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"`
}

RouterInfo holds information about a currently running HTTP router

func (*RouterInfo) AddError

func (r *RouterInfo) AddError(err error, critical bool)

AddError adds err to r.Err, if it does not already exist. If critical is set, r is marked as disabled.

type ServiceInfo

type ServiceInfo struct {
	*dynamic.Service // dynamic configuration
	// 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
	// contains filtered or unexported fields
}

ServiceInfo holds information about a currently running service

func (*ServiceInfo) AddError

func (s *ServiceInfo) AddError(err error, critical bool)

AddError adds err to s.Err, if it does not already exist. If critical is set, s is marked as disabled.

func (*ServiceInfo) GetAllStatus

func (s *ServiceInfo) GetAllStatus() map[string]string

GetAllStatus returns all the statuses of all the servers in ServiceInfo. It is the responsibility of the caller to check that s is not nil

func (*ServiceInfo) UpdateServerStatus

func (s *ServiceInfo) UpdateServerStatus(server string, status string)

UpdateServerStatus sets the status of the server in the ServiceInfo. It is the responsibility of the caller to check that s is not nil.

type TCPRouterInfo

type TCPRouterInfo struct {
	*dynamic.TCPRouter          // dynamic configuration
	Err                []string `json:"error,omitempty"` // initialization error
	// Status reports whether the router 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"`
}

TCPRouterInfo holds information about a currently running TCP router

func (*TCPRouterInfo) AddError

func (r *TCPRouterInfo) AddError(err error, critical bool)

AddError adds err to r.Err, if it does not already exist. If critical is set, r is marked as disabled.

type TCPServiceInfo

type TCPServiceInfo struct {
	*dynamic.TCPService          // dynamic configuration
	Err                 []string `json:"error,omitempty"` // initialization error
	// 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
}

TCPServiceInfo holds information about a currently running TCP service

func (*TCPServiceInfo) AddError

func (s *TCPServiceInfo) AddError(err error, critical bool)

AddError adds err to s.Err, if it does not already exist. If critical is set, s is marked as disabled.

Jump to

Keyboard shortcuts

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