config.go 645 B

12345678910111213141516171819202122232425
  1. package config
  2. import (
  3. "io"
  4. "git.ali33.ru/fcg-xvii/go-tools/value"
  5. )
  6. type Section interface {
  7. ValueSetup(name string, ptr interface{}) bool
  8. Value(name string) (value.Value, bool)
  9. ValueDefault(name string, defaultVal interface{}) interface{}
  10. SetValue(name string, value interface{})
  11. Save(io.Writer) error
  12. }
  13. type Config interface {
  14. AppendSection(name string) (newSection Section)
  15. Section(name string) (Section, bool)
  16. Sections(name string) ([]Section, bool)
  17. ValueSetup(name string, ptr interface{}) bool
  18. Value(name string) (value.Value, bool)
  19. ValueDefault(name string, defaultVal interface{}) interface{}
  20. Save(io.Writer) error
  21. }