forked from Ivasoft/traefik
Add KV store providers (dynamic configuration only)
Co-authored-by: Jean-Baptiste Doumenjou <jb.doumenjou@gmail.com>
This commit is contained in:
committed by
Traefiker Bot
parent
028683666d
commit
9b9f4be6a4
@@ -13,12 +13,13 @@ func Decode(labels map[string]string, element interface{}, rootName string, filt
|
||||
return err
|
||||
}
|
||||
|
||||
err = AddMetadata(element, node)
|
||||
metaOpts := MetadataOpts{TagName: TagLabel, AllowSliceAsStruct: true}
|
||||
err = AddMetadata(element, node, metaOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = Fill(element, node)
|
||||
err = Fill(element, node, FillerOpts{AllowSliceAsStruct: true})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -29,7 +30,8 @@ func Decode(labels map[string]string, element interface{}, rootName string, filt
|
||||
// Encode converts an element to labels.
|
||||
// element -> node (value) -> label (node)
|
||||
func Encode(element interface{}, rootName string) (map[string]string, error) {
|
||||
node, err := EncodeToNode(element, rootName, true)
|
||||
etnOpts := EncoderToNodeOpts{OmitEmpty: true, TagName: TagLabel, AllowSliceAsStruct: true}
|
||||
node, err := EncodeToNode(element, rootName, etnOpts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user