Documentation ¶
Index ¶
- Constants
- type Configuration
- func (c *Configuration) GetRoutersByEntryPoints(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*RouterInfo
- func (c *Configuration) GetTCPRoutersByEntryPoints(ctx context.Context, entryPoints []string) map[string]map[string]*TCPRouterInfo
- func (c *Configuration) GetUDPRoutersByEntryPoints(ctx context.Context, entryPoints []string) map[string]map[string]*UDPRouterInfo
- func (c *Configuration) PopulateUsedBy()
- type MiddlewareInfo
- type RouterInfo
- type ServiceInfo
- type TCPRouterInfo
- type TCPServiceInfo
- type UDPRouterInfo
- type UDPServiceInfo
Constants ¶
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"` UDPRouters map[string]*UDPRouterInfo `json:"udpRouters,omitempty"` UDPServices map[string]*UDPServiceInfo `json:"updServices,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) GetUDPRoutersByEntryPoints ¶ added in v2.2.0
func (c *Configuration) GetUDPRoutersByEntryPoints(ctx context.Context, entryPoints []string) map[string]map[string]*UDPRouterInfo
GetUDPRoutersByEntryPoints returns all the UDP 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"` Using []string `json:"using,omitempty"` // Effective entry points used by that router. }
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, 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"` Using []string `json:"using,omitempty"` // Effective entry points used by that router. }
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.
type UDPRouterInfo ¶ added in v2.2.0
type UDPRouterInfo struct { *dynamic.UDPRouter // 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"` Using []string `json:"using,omitempty"` // Effective entry points used by that router. }
UDPRouterInfo holds information about a currently running UDP router.
func (*UDPRouterInfo) AddError ¶ added in v2.2.0
func (r *UDPRouterInfo) 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 UDPServiceInfo ¶ added in v2.2.0
type UDPServiceInfo struct { *dynamic.UDPService // 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 }
UDPServiceInfo holds information about a currently running UDP service.
func (*UDPServiceInfo) AddError ¶ added in v2.2.0
func (s *UDPServiceInfo) 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.