mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-04 01:57:45 +00:00
Update dependencies (#1951)
This commit is contained in:
29
vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
generated
vendored
29
vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
generated
vendored
@ -1,39 +1,16 @@
|
||||
//go:build viper_toml1
|
||||
// +build viper_toml1
|
||||
|
||||
package toml
|
||||
|
||||
import (
|
||||
"github.com/pelletier/go-toml"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
)
|
||||
|
||||
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for TOML encoding.
|
||||
type Codec struct{}
|
||||
|
||||
func (Codec) Encode(v map[string]interface{}) ([]byte, error) {
|
||||
t, err := toml.TreeFromMap(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s, err := t.ToTomlString()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return []byte(s), nil
|
||||
return toml.Marshal(v)
|
||||
}
|
||||
|
||||
func (Codec) Decode(b []byte, v map[string]interface{}) error {
|
||||
tree, err := toml.LoadBytes(b)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tmap := tree.ToMap()
|
||||
for key, value := range tmap {
|
||||
v[key] = value
|
||||
}
|
||||
|
||||
return nil
|
||||
return toml.Unmarshal(b, &v)
|
||||
}
|
||||
|
19
vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go
generated
vendored
19
vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go
generated
vendored
@ -1,19 +0,0 @@
|
||||
//go:build !viper_toml1
|
||||
// +build !viper_toml1
|
||||
|
||||
package toml
|
||||
|
||||
import (
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
)
|
||||
|
||||
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for TOML encoding.
|
||||
type Codec struct{}
|
||||
|
||||
func (Codec) Encode(v map[string]interface{}) ([]byte, error) {
|
||||
return toml.Marshal(v)
|
||||
}
|
||||
|
||||
func (Codec) Decode(b []byte, v map[string]interface{}) error {
|
||||
return toml.Unmarshal(b, &v)
|
||||
}
|
2
vendor/github.com/spf13/viper/internal/encoding/yaml/codec.go
generated
vendored
2
vendor/github.com/spf13/viper/internal/encoding/yaml/codec.go
generated
vendored
@ -1,6 +1,6 @@
|
||||
package yaml
|
||||
|
||||
// import "gopkg.in/yaml.v2"
|
||||
import "gopkg.in/yaml.v3"
|
||||
|
||||
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for YAML encoding.
|
||||
type Codec struct{}
|
||||
|
14
vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go
generated
vendored
14
vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go
generated
vendored
@ -1,14 +0,0 @@
|
||||
//go:build viper_yaml2
|
||||
// +build viper_yaml2
|
||||
|
||||
package yaml
|
||||
|
||||
import yamlv2 "gopkg.in/yaml.v2"
|
||||
|
||||
var yaml = struct {
|
||||
Marshal func(in interface{}) (out []byte, err error)
|
||||
Unmarshal func(in []byte, out interface{}) (err error)
|
||||
}{
|
||||
Marshal: yamlv2.Marshal,
|
||||
Unmarshal: yamlv2.Unmarshal,
|
||||
}
|
14
vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go
generated
vendored
14
vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go
generated
vendored
@ -1,14 +0,0 @@
|
||||
//go:build !viper_yaml2
|
||||
// +build !viper_yaml2
|
||||
|
||||
package yaml
|
||||
|
||||
import yamlv3 "gopkg.in/yaml.v3"
|
||||
|
||||
var yaml = struct {
|
||||
Marshal func(in interface{}) (out []byte, err error)
|
||||
Unmarshal func(in []byte, out interface{}) (err error)
|
||||
}{
|
||||
Marshal: yamlv3.Marshal,
|
||||
Unmarshal: yamlv3.Unmarshal,
|
||||
}
|
Reference in New Issue
Block a user