1 Star 0 Fork 2

QunXiongZhuLu/kratos

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
client.go 820 Bytes
Copy Edit Raw Blame History
felixhao authored 2019-04-04 15:44 +08:00 . add conf paladin
package paladin
import (
"context"
)
const (
// EventAdd config add event.
EventAdd EventType = iota
// EventUpdate config update event.
EventUpdate
// EventRemove config remove event.
EventRemove
)
// EventType is config event.
type EventType int
// Event is watch event.
type Event struct {
Event EventType
Key string
Value string
}
// Watcher is config watcher.
type Watcher interface {
WatchEvent(context.Context, ...string) <-chan Event
Close() error
}
// Setter is value setter.
type Setter interface {
Set(string) error
}
// Getter is value getter.
type Getter interface {
// Get a config value by a config key(may be a sven filename).
Get(string) *Value
// GetAll return all config key->value map.
GetAll() *Map
}
// Client is config client.
type Client interface {
Watcher
Getter
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/QunXiongZhuLu/kratos.git
git@gitee.com:QunXiongZhuLu/kratos.git
QunXiongZhuLu
kratos
kratos
v0.6.2

Search