package config import ( "github.com/go-kratos/kratos/v2/config" ) type Source interface { NewSource() (config.Source, error) Validate() bool String() string } type Format string const ( Yaml Format = "yaml" ) var formatMap = map[Format]string{ Yaml: "yaml", } func (f Format) String() string { return string(f) } func (f Format) Validate() bool { _, ok := formatMap[f] return ok }