socket

package
v6.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EVENT_ONLINE agent online event
	EVENT_ONLINE = "ONLINE"
	// EVENT_OFFLINE agent offline event
	EVENT_OFFLINE = "OFFLINE"
)

Variables

This section is empty.

Functions

func EnforceKickOffline

func EnforceKickOffline(sessionId string) *tp.Status

EnforceKickOffline enforches kick the user offline.

func GetAgent

func GetAgent(sessionId string) (*aproto.Agent, *tp.Status)

GetAgent returns agent information.

func GetSocketHooks

func GetSocketHooks() types.SocketHooks

GetSocketHooks returns the custom agent types.SocketHooks interface.

func Init

func Init(redisWithLargeMemory *redis.Client, redisWithPublishCmd *redis.Client, namespace ...string) error

Init initializes agent packet.

func QueryAgent

func QueryAgent(sessionIds []string) (*aproto.Agents, *tp.Status)

QueryAgent queries agent information in batches.

func Subscribe

func Subscribe() <-chan *AgentNews

Subscribe subscribes agent news from redis.

Types

type AgentNews

type AgentNews struct {
	SessionId string
	Event     string
}

AgentNews agent online/offline message

func (*AgentNews) IsOffline

func (a *AgentNews) IsOffline() bool

IsOffline returns whether it is an offline message.

func (*AgentNews) IsOnline

func (a *AgentNews) IsOnline() bool

IsOnline returns whether it is an online message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL