add basic config and change i18n pkg

This commit is contained in:
Livio Amstutz
2020-03-25 07:58:58 +01:00
parent 96b88f5d8c
commit 5cd9ca506a
21 changed files with 515 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ import (
"path/filepath"
"github.com/BurntSushi/toml"
"gopkg.in/yaml.v2"
"github.com/ghodss/yaml"
"github.com/caos/zitadel/internal/errors"
)
@@ -21,7 +21,7 @@ type ReaderFunc func(data []byte, o interface{}) error
var (
JSONReader = json.Unmarshal
TOMLReader = toml.Unmarshal
YAMLReader = yaml.Unmarshal
YAMLReader = func(data []byte, o interface{}) error { return yaml.Unmarshal(data, o) }
)
// Read deserializes each config file to the target obj

14
internal/config/flag.go Normal file
View File

@@ -0,0 +1,14 @@
package config
import "strings"
type ArrayFlags []string
func (i *ArrayFlags) String() string {
return strings.Join(*i, ";")
}
func (i *ArrayFlags) Set(value string) error {
*i = append(*i, value)
return nil
}