This commit is contained in:
chowyu08
2017-08-25 21:29:03 +08:00
parent 5c6e136c2b
commit 80e118728d
8 changed files with 342 additions and 46 deletions

View File

@@ -2,7 +2,7 @@ package broker
import "sync"
type ClientMap interface {
type cMap interface {
Set(key string, val *client)
Get(key string) (*client, bool)
Items() map[string]*client
@@ -17,7 +17,7 @@ type clientMap struct {
mu sync.RWMutex
}
func NewClientMap() ClientMap {
func NewClientMap() cMap {
smap := &clientMap{
items: make(map[string]*client),
}