Documentation
¶
Overview ¶
Package traefik implements the Traefik reverse-proxy API provider.
Index ¶
Constants ¶
View Source
const ( ID = "traefik" EndpointKey = "endpoint" UsernameKey = "username" PasswordKey = "password" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Overview ¶
type Overview struct {
HTTP *ProtocolStats `json:"http"`
TCP *ProtocolStats `json:"tcp"`
UDP *ProtocolStats `json:"udp"`
Features map[string]any `json:"features"`
}
Overview is Traefik /api/overview statistics.
type ProtocolStats ¶
type ProtocolStats struct {
Routers map[string]int `json:"routers"`
Services map[string]int `json:"services"`
Middlewares map[string]int `json:"middlewares"`
}
ProtocolStats holds counts for a protocol family.
type Router ¶
type Router struct {
Name string `json:"name"`
Rule string `json:"rule"`
Service string `json:"service"`
Status string `json:"status"`
Provider string `json:"provider"`
EntryPoints []string `json:"entryPoints"`
Priority int64 `json:"priority"`
}
Router is an HTTP router from Traefik.
type Service ¶
type Service struct {
Name string `json:"name"`
Type string `json:"type"`
Status string `json:"status"`
Provider string `json:"provider"`
}
Service is an HTTP service from Traefik.
type Traefik ¶
type Traefik struct {
// contains filtered or unexported fields
}
Traefik is an HTTP client for the Traefik API.
func GetClient ¶
func GetClient() *Traefik
GetClient builds a Traefik client from vendors.traefik config. Returns nil when endpoint is not configured.
func NewTraefik ¶
NewTraefik creates a Traefik client with optional Basic auth. Returns nil when endpoint is empty.
func (*Traefik) ListRouters ¶
ListRouters returns HTTP routers.
func (*Traefik) ListServices ¶
ListServices returns HTTP services.
Click to show internal directories.
Click to hide internal directories.