1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/config/reader/reader.go

39 lines
888 B
Go
Raw Normal View History

2019-05-31 00:11:13 +02:00
// Package reader parses change sets and provides config values
package reader
import (
"time"
2021-10-12 13:55:53 +02:00
"go-micro.dev/v4/config/source"
2019-05-31 00:11:13 +02:00
)
2022-09-30 16:27:07 +02:00
// Reader is an interface for merging changesets.
2019-05-31 00:11:13 +02:00
type Reader interface {
Merge(...*source.ChangeSet) (*source.ChangeSet, error)
Values(*source.ChangeSet) (Values, error)
String() string
}
2022-09-30 16:27:07 +02:00
// Values is returned by the reader.
2019-05-31 00:11:13 +02:00
type Values interface {
Bytes() []byte
Get(path ...string) Value
Set(val interface{}, path ...string)
Del(path ...string)
2019-05-31 00:11:13 +02:00
Map() map[string]interface{}
Scan(v interface{}) error
}
2022-09-30 16:27:07 +02:00
// Value represents a value of any type.
2019-05-31 00:11:13 +02:00
type Value interface {
Bool(def bool) bool
Int(def int) int
String(def string) string
Float64(def float64) float64
Duration(def time.Duration) time.Duration
StringSlice(def []string) []string
StringMap(def map[string]string) map[string]string
Scan(val interface{}) error
Bytes() []byte
}