change create->new, follow go spec

This commit is contained in:
Xiang Li
2013-08-04 17:17:40 -07:00
parent ce33c4d29f
commit 8a4b2e83a5
3 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -126,7 +126,7 @@ func CreateStore(max int) *Store {
},
}
s.watcher = createWatcherHub()
s.watcher = newWatcherHub()
return s
}

View File

@@ -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)}
}