| 1234567891011121314151617181920212223242526272829303132 |
- 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"
- Json Format = "json"
- )
- var formatMap = map[Format]string{
- Yaml: "yaml",
- Json: "json",
- }
- func (f Format) String() string {
- return string(f)
- }
- func (f Format) Validate() bool {
- _, ok := formatMap[f]
- return ok
- }
|