Documentation ¶
Index ¶
- type Broker
- func (b *Broker) GetActiveAgents(user string) map[string]wire.UID
- func (b *Broker) GetEventManager() *noti.EventManager
- func (b *Broker) GetHub(user string) *Hub
- func (b *Broker) RemoveAgent(agentid, user string)
- func (b *Broker) ServeAgentWebsocket(w http.ResponseWriter, r *http.Request)
- func (b *Broker) ServeUserWebsocket(w http.ResponseWriter, r *http.Request)
- type DirectPacket
- type Hub
- type NodeConn
- type NodeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { BLock sync.Mutex Hubs map[string]*Hub // contains filtered or unexported fields }
func (*Broker) GetEventManager ¶
func (b *Broker) GetEventManager() *noti.EventManager
func (*Broker) RemoveAgent ¶
func (*Broker) ServeAgentWebsocket ¶
func (b *Broker) ServeAgentWebsocket(w http.ResponseWriter, r *http.Request)
ServeAgentWebsocket serves agents
func (*Broker) ServeUserWebsocket ¶
func (b *Broker) ServeUserWebsocket(w http.ResponseWriter, r *http.Request)
ServeUserWebsocket serves users websocket conn
type DirectPacket ¶
type Hub ¶
type Hub struct { AllUserConns map[wire.UID]*NodeConn // TODO lock if .. AllAgentConns map[wire.UID]*NodeConn ListOfAgents map[string]wire.UID // agentkey (not deploy key) with one most current connection AddConnection chan *NodeConn RemoveConnection chan *NodeConn PacketChan chan *packet CDirectSend chan *DirectPacket Ctx context.Context CtxCancel context.CancelFunc IDGenerator *generator BroadCastEvent chan []byte // contains filtered or unexported fields }
type NodeConn ¶
type NodeConn struct { Connectionid wire.UID Identifier string // key for agent userid for user Type NodeType // UserType or AgentType CloseReader context.CancelFunc CloseWriter context.CancelFunc MyHub *Hub Running bool // contains filtered or unexported fields }
NodeConn is used to represent both userconnection and agent connection
func NewNodeConn ¶
Click to show internal directories.
Click to hide internal directories.