Documentation
¶
Index ¶
- Variables
- type FileExporter
- type Option
- func WithCertResolver(resolver string) Option
- func WithDefaultMiddlewares(middlewares ...string) Option
- func WithEntryPoints(entryPoints ...string) Option
- func WithHost(host string) Option
- func WithOutputFile(path string) Option
- func WithPolicyMiddlewares(policy string, middlewares ...string) Option
- func WithRouterPrefix(prefix string) Option
- func WithService(service string) Option
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type FileExporter ¶
type FileExporter struct {
// contains filtered or unexported fields
}
func NewFileExporter ¶
func NewFileExporter(opts ...Option) *FileExporter
NewFileExporter creates an exporter that writes the defined routes as a Traefik v3 dynamic configuration file, one router per route. Internal routes are left out.
type Option ¶
type Option func(*FileExporter)
func WithCertResolver ¶
WithCertResolver enables TLS on every router using the given cert resolver.
func WithDefaultMiddlewares ¶
WithDefaultMiddlewares sets Traefik middlewares applied to every router, before any policy middlewares.
func WithEntryPoints ¶
WithEntryPoints sets the Traefik entry points every router listens on. Without it routers listen on all of Traefik's default entry points.
func WithOutputFile ¶
WithOutputFile sets the file the dynamic configuration is written to. Without it the exporter does nothing.
func WithPolicyMiddlewares ¶
WithPolicyMiddlewares maps a policy registered on the HTTP module to Traefik middlewares, added to the router of every route that applies the policy.
func WithRouterPrefix ¶
WithRouterPrefix prefixes every router name, e.g. with the service name, to keep names unique across services sharing one Traefik instance. The prefix is lowercased and characters other than a-z, 0-9, '_' and '-' become '-'.
func WithService ¶
WithService sets the Traefik service every router forwards to.