mirror of
https://github.com/mailgun/groupcache.git
synced 2024-10-02 21:02:08 +00:00
26 lines
471 B
Go
26 lines
471 B
Go
package groupcache
|
|
|
|
import "sync"
|
|
|
|
type workspace struct {
|
|
httpPoolMade bool
|
|
portPicker func(groupName string) PeerPicker
|
|
|
|
mu sync.RWMutex
|
|
groups map[string]*Group
|
|
|
|
initPeerServerOnce sync.Once
|
|
initPeerServer func()
|
|
|
|
// newGroupHook, if non-nil, is called right after a new group is created.
|
|
newGroupHook func(*Group)
|
|
}
|
|
|
|
var DefaultWorkspace = NewWorkspace()
|
|
|
|
func NewWorkspace() *workspace {
|
|
return &workspace{
|
|
groups: make(map[string]*Group),
|
|
}
|
|
}
|