Configuration: 1) Add scheme syntax support to Preset Meta; 2) Some wrong defaults has now been fixed

This commit is contained in:
NI
2020-08-13 22:37:53 +08:00
parent 1c018ce560
commit d86c92867c
7 changed files with 271 additions and 48 deletions

View File

@@ -120,6 +120,27 @@ func (s Server) Verify() error {
return nil
}
// Meta contains data of a Key -> Value map which can be use to store
// dynamically structured configuration options
type Meta map[string]String
// Concretize returns an concretized Meta as a `map[string]string`
func (m Meta) Concretize() (map[string]string, error) {
mm := make(map[string]string, len(m))
for k, v := range m {
result, err := v.Parse()
if err != nil {
return nil, fmt.Errorf("Unable to parse Meta \"%s\": %s", k, err)
}
mm[k] = result
}
return mm, nil
}
// Preset contains data of a static remote host
type Preset struct {
Title string