syntactic changes
This commit is contained in:
parent
8855beb62d
commit
8fdc050e2e
@ -41,6 +41,7 @@ var (
|
|||||||
|
|
||||||
// router implements default router
|
// router implements default router
|
||||||
type router struct {
|
type router struct {
|
||||||
|
sync.RWMutex
|
||||||
// embed the table
|
// embed the table
|
||||||
*table
|
*table
|
||||||
opts Options
|
opts Options
|
||||||
@ -51,7 +52,6 @@ type router struct {
|
|||||||
advertChan chan *Advert
|
advertChan chan *Advert
|
||||||
advertWg *sync.WaitGroup
|
advertWg *sync.WaitGroup
|
||||||
wg *sync.WaitGroup
|
wg *sync.WaitGroup
|
||||||
sync.RWMutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newRouter creates new router and returns it
|
// newRouter creates new router and returns it
|
||||||
|
@ -17,11 +17,11 @@ var (
|
|||||||
|
|
||||||
// table is an in memory routing table
|
// table is an in memory routing table
|
||||||
type table struct {
|
type table struct {
|
||||||
|
sync.RWMutex
|
||||||
// routes stores service routes
|
// routes stores service routes
|
||||||
routes map[string]map[uint64]Route
|
routes map[string]map[uint64]Route
|
||||||
// watchers stores table watchers
|
// watchers stores table watchers
|
||||||
watchers map[string]*tableWatcher
|
watchers map[string]*tableWatcher
|
||||||
sync.RWMutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newtable creates a new routing table and returns it
|
// newtable creates a new routing table and returns it
|
||||||
|
@ -71,10 +71,10 @@ func WatchService(s string) WatchOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type tableWatcher struct {
|
type tableWatcher struct {
|
||||||
|
sync.RWMutex
|
||||||
opts WatchOptions
|
opts WatchOptions
|
||||||
resChan chan *Event
|
resChan chan *Event
|
||||||
done chan struct{}
|
done chan struct{}
|
||||||
sync.RWMutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next returns the next noticed action taken on table
|
// Next returns the next noticed action taken on table
|
||||||
|
Loading…
x
Reference in New Issue
Block a user