Skip to content

Commit 6b7abb4

Browse files
committed
update
1 parent 82cbfb9 commit 6b7abb4

File tree

8 files changed

+10
-1731
lines changed

8 files changed

+10
-1731
lines changed

azureappconfiguration.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import (
1010
"regexp"
1111
"strings"
1212

13-
"github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration/internal/decoder"
13+
"github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration/internal/tree"
1414
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
15+
decoder "github.com/go-viper/mapstructure/v2"
1516
"golang.org/x/sync/errgroup"
1617
)
1718

@@ -67,13 +68,14 @@ func (azappcfg *AzureAppConfiguration) Unmarshal(rawVal any, options *Constructi
6768
Metadata: nil,
6869
Result: rawVal,
6970
WeaklyTypedInput: true,
71+
TagName: "json",
7072
DecodeHook: decoder.ComposeDecodeHookFunc(
7173
decoder.StringToTimeDurationHookFunc(),
7274
decoder.StringToSliceHookFunc(","),
7375
),
7476
}
7577

76-
decoder, err := decoder.New(config)
78+
decoder, err := decoder.NewDecoder(config)
7779
if err != nil {
7880
return err
7981
}
@@ -219,7 +221,7 @@ func deduplicateSelectors(selectors []Selector) []Selector {
219221

220222
// constructHierarchicalMap converts a flat map with delimited keys to a hierarchical structure
221223
func (azappcfg *AzureAppConfiguration) constructHierarchicalMap(separator string) map[string]any {
222-
tree := &decoder.Tree{}
224+
tree := &tree.Tree{}
223225
for k, v := range azappcfg.keyValues {
224226
tree.Insert(strings.Split(k, separator), v)
225227
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
require (
1616
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
1717
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
18+
github.com/go-viper/mapstructure/v2 v2.2.1
1819
github.com/stretchr/testify v1.10.0
1920
golang.org/x/net v0.35.0 // indirect
2021
golang.org/x/sync v0.11.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 h1:H5xDQaE3Xow
1010
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
1111
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1212
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
13+
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
14+
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
1315
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
1416
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
1517
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=

internal/decoder/decode_hooks.go

Lines changed: 0 additions & 286 deletions
This file was deleted.

0 commit comments

Comments
 (0)