mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
Remove app/config/yaml.go as we use viper and mapstructure to parse.
This commit is contained in:
parent
a0b88d1991
commit
33efb36901
1 changed files with 0 additions and 26 deletions
|
|
@ -1,26 +0,0 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func (ship *ShipConfig) UnmarshalYAML(value *yaml.Node) error {
|
||||
var err error
|
||||
|
||||
if value.Kind == yaml.ScalarNode {
|
||||
ship.Url = value.Value
|
||||
} else {
|
||||
type ShipConfigRaw ShipConfig
|
||||
raw := ShipConfigRaw(*ship)
|
||||
if err = value.Decode(&raw); err == nil {
|
||||
*ship = ShipConfig(raw)
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Read YAML config data
|
||||
func (cfg *Config) ReadYAML(data []byte) error {
|
||||
return yaml.Unmarshal(data, cfg)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue