component

package
v0.0.0-...-2130a7a Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentComponent

type AgentComponent struct {
	// contains filtered or unexported fields
}

func NewAgentComponent

func NewAgentComponent(p int, ctx core.ServerContext) *AgentComponent

func (*AgentComponent) KickClient

func (a *AgentComponent) KickClient(ctx context.Context, req *agent.Request) (*agent.Response, error)

func (*AgentComponent) KickRemote

func (a *AgentComponent) KickRemote(clientId, hostAddr string) error

func (*AgentComponent) PubMsg

func (a *AgentComponent) PubMsg(ctx context.Context, req *agent.Request) (*agent.Response, error)

func (*AgentComponent) PubMsgRemote

func (a *AgentComponent) PubMsgRemote(clientId string, content []byte, hostAddr string) error

func (*AgentComponent) Start

func (a *AgentComponent) Start()

type Auth

type Auth struct {
}

type Plugin

type Plugin interface {
	Register(p Plugin, priority int)
	OnConnect(clientId, userName, passWord string) bool
	OnMessage()
}

type SessionComponent

type SessionComponent struct {
	// contains filtered or unexported fields
}

func NewSessionComponent

func NewSessionComponent(addr string, redisPool *redis.Pool) *SessionComponent

func (*SessionComponent) DelSession

func (s *SessionComponent) DelSession(clientId string) error

func (*SessionComponent) GetSession

func (s *SessionComponent) GetSession(clientId string) (res string, err error)

func (*SessionComponent) RetrieveSubscribers

func (t *SessionComponent) RetrieveSubscribers(topic string) ([]string, error)

func (*SessionComponent) SaveSession

func (s *SessionComponent) SaveSession(clientId string) error

type TopicComponent

type TopicComponent struct {
	// contains filtered or unexported fields
}

func NewTopicComponent

func NewTopicComponent(addr string, redisPool *redis.Pool) *TopicComponent

func (*TopicComponent) RetrieveSubscribers

func (t *TopicComponent) RetrieveSubscribers(topic string) ([]string, error)

func (*TopicComponent) SubTopic

func (t *TopicComponent) SubTopic(topic, clientId string) error

Jump to

Keyboard shortcuts

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