mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
change create->new, follow go spec
This commit is contained in:
@@ -93,7 +93,7 @@ func (c *WatchCommand) CommandName() string {
|
||||
|
||||
func (c *WatchCommand) Apply(server *raft.Server) (interface{}, error) {
|
||||
// create a new watcher
|
||||
watcher := store.CreateWatcher()
|
||||
watcher := store.NewWatcher()
|
||||
|
||||
// add to the watchers list
|
||||
etcdStore.AddWatcher(c.Key, watcher, c.SinceIndex)
|
||||
|
||||
@@ -126,7 +126,7 @@ func CreateStore(max int) *Store {
|
||||
},
|
||||
}
|
||||
|
||||
s.watcher = createWatcherHub()
|
||||
s.watcher = newWatcherHub()
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ type Watcher struct {
|
||||
}
|
||||
|
||||
// Create a new watcherHub
|
||||
func createWatcherHub() *WatcherHub {
|
||||
func newWatcherHub() *WatcherHub {
|
||||
w := new(WatcherHub)
|
||||
w.watchers = make(map[string][]*Watcher)
|
||||
return w
|
||||
}
|
||||
|
||||
// Create a new watcher
|
||||
func CreateWatcher() *Watcher {
|
||||
func NewWatcher() *Watcher {
|
||||
return &Watcher{C: make(chan *Response, 1)}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user