provider

package
v1.7.22-h2c Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize added in v1.3.0

func Normalize(name string) string

Normalize transform a string that work with the rest of traefik Replace '.' with '-' in quoted keys because of this issue https://github.com/BurntSushi/toml/issues/78

func ReverseStringSlice added in v1.3.0

func ReverseStringSlice(slice *[]string)

ReverseStringSlice invert the order of the given slice of string

Types

type BaseProvider

type BaseProvider struct {
	Watch                     bool              `description:"Watch provider" export:"true"`
	Filename                  string            `description:"Override default configuration template. For advanced users :)" export:"true"`
	Constraints               types.Constraints `description:"Filter services by constraint, matching with Traefik tags." export:"true"`
	Trace                     bool              `description:"Display additional provider logs (if available)." export:"true"`
	TemplateVersion           int               `description:"Template version." export:"true"`
	DebugLogGeneratedTemplate bool              `description:"Enable debug logging of generated configuration template." export:"true"`
}

BaseProvider should be inherited by providers

func (*BaseProvider) CreateConfiguration added in v1.6.0

func (p *BaseProvider) CreateConfiguration(tmplContent string, funcMap template.FuncMap, templateObjects interface{}) (*types.Configuration, error)

CreateConfiguration create a provider configuration from content using templating

func (*BaseProvider) DecodeConfiguration added in v1.6.2

func (p *BaseProvider) DecodeConfiguration(content string) (*types.Configuration, error)

DecodeConfiguration Decode a *types.Configuration from a content

func (*BaseProvider) GetConfiguration added in v1.3.0

func (p *BaseProvider) GetConfiguration(defaultTemplate string, funcMap template.FuncMap, templateObjects interface{}) (*types.Configuration, error)

GetConfiguration return the provider configuration from default template (file or content) or overrode template file

func (*BaseProvider) Init added in v1.7.0

func (p *BaseProvider) Init(constraints types.Constraints) error

Init for compatibility reason the BaseProvider implements an empty Init

func (*BaseProvider) MatchConstraints

func (p *BaseProvider) MatchConstraints(tags []string) (bool, *types.Constraint)

MatchConstraints must match with EVERY single constraint returns first constraint that do not match or nil

type Provider

type Provider interface {
	// Provide allows the provider to provide configurations to traefik
	// using the given configuration channel.
	Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool) error
	Init(constraints types.Constraints) error
}

Provider defines methods of a provider.

Directories

Path Synopsis
mocks
Package mocks Code generated by mockery v1.0.0.
Package mocks Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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