6cf6f95f58
CodeQL / Analyze (push) Has been cancelled
Sync to Gitee / Run (push) Has been cancelled
Go / build & test (1.25.x) (push) Has been cancelled
Go / build & test (1.26.x) (push) Has been cancelled
Lint / resolve module (push) Has been cancelled
Lint / lint module (push) Has been cancelled
21 lines
341 B
Go
21 lines
341 B
Go
package config
|
|
|
|
// KeyValue is config key value.
|
|
type KeyValue struct {
|
|
Key string
|
|
Value []byte
|
|
Format string
|
|
}
|
|
|
|
// Source is config source.
|
|
type Source interface {
|
|
Load() ([]*KeyValue, error)
|
|
Watch() (Watcher, error)
|
|
}
|
|
|
|
// Watcher watches a source for changes.
|
|
type Watcher interface {
|
|
Next() ([]*KeyValue, error)
|
|
Stop() error
|
|
}
|