Documentation ¶
Index ¶
Constants ¶
View Source
const (
)Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentTree ¶
type ConcurrentTree struct {
// contains filtered or unexported fields
}
* thread safe tree,depends on "github.com/orcaman/concurrent-map"
func NewTree ¶
func NewTree(root string) *ConcurrentTree
* build a thread safe tree,root as root node clientId
func (*ConcurrentTree) String ¶
func (t *ConcurrentTree) String() string
type LocalTree ¶
type LocalTree struct {
// contains filtered or unexported fields
}
* struct a Subscribe tree,store Subscribe Client and path
func (*LocalTree) AddNodes ¶
func (st *LocalTree) AddNodes(ts []string, dataKey string, dataVal *SubscribeThing)
* give a topic array,tree will add all nodes
func (*LocalTree) GetSubscribers ¶
func (st *LocalTree) GetSubscribers(topic string) (map[string]*SubscribeThing, error)
type Manager ¶
type Manager interface { AddNodes(ts []string, dataKey string, dataVal *SubscribeThing) GetSubscribers(topic string) (map[string]*SubscribeThing, error) Subscribe(topic string, thing *SubscribeThing) error }
func NewManager ¶
func NewManager() Manager
type SubscribeThing ¶
type SubscribeThing struct { Id string Client interface{} //store client pointer // contains filtered or unexported fields }
func NewSubscribeThing ¶
func NewSubscribeThing(id string, client interface{}) *SubscribeThing
type TreeNode ¶
type TreeNode struct { Id string Data cmap.ConcurrentMap // contains filtered or unexported fields }
func NewTreeNode ¶
Click to show internal directories.
Click to hide internal directories.