traefik/pkg/provider/consulcatalog/label.go

24 lines
565 B
Go
Raw Normal View History

2019-10-15 15:34:08 +00:00
package consulcatalog
import (
"github.com/containous/traefik/v2/pkg/config/label"
)
// configuration Contains information from the labels that are globals (not related to the dynamic configuration) or specific to the provider.
type configuration struct {
Enable bool
}
func (p *Provider) getConfiguration(item itemData) (configuration, error) {
conf := configuration{
Enable: p.ExposedByDefault,
}
err := label.Decode(item.Labels, &conf, "traefik.consulcatalog.", "traefik.enable")
if err != nil {
return configuration{}, err
}
return conf, nil
}