agent

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package agent is a generated protocol buffer package.

It is generated from these files:

agent.proto

It has these top-level messages:

Agent
Agents

Index

Constants

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

Variables

View Source
var (
	ErrInvalidLengthAgent = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAgent   = fmt.Errorf("proto: integer overflow")
)

Functions

func EnforceKickOffline

func EnforceKickOffline(sessionId string) *tp.Rerror

EnforceKickOffline enforches kick the user offline.

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 Subscribe

func Subscribe() <-chan *AgentNews

Subscribe subscribes agent news from redis.

Types

type Agent

type Agent struct {
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	InnerGw   string `protobuf:"bytes,2,opt,name=inner_gw,json=innerGw,proto3" json:"inner_gw,omitempty"`
	OnlineAt  int64  `protobuf:"varint,3,opt,name=online_at,json=onlineAt,proto3" json:"online_at,omitempty"`
	IsOffline bool   `protobuf:"varint,4,opt,name=is_offline,json=isOffline,proto3" json:"is_offline,omitempty"`
	Salt      uint64 `protobuf:"varint,5,opt,name=salt,proto3" json:"salt,omitempty"`
}

func GetAgent

func GetAgent(sessionId string) (*Agent, *tp.Rerror)

GetAgent returns agent information.

func (*Agent) Descriptor

func (*Agent) Descriptor() ([]byte, []int)

func (*Agent) GetInnerGw

func (m *Agent) GetInnerGw() string

func (*Agent) GetIsOffline

func (m *Agent) GetIsOffline() bool

func (*Agent) GetOnlineAt

func (m *Agent) GetOnlineAt() int64

func (*Agent) GetSalt

func (m *Agent) GetSalt() uint64

func (*Agent) GetSessionId

func (m *Agent) GetSessionId() string

func (*Agent) Marshal

func (m *Agent) Marshal() (dAtA []byte, err error)

func (*Agent) MarshalTo

func (m *Agent) MarshalTo(dAtA []byte) (int, error)

func (*Agent) ProtoMessage

func (*Agent) ProtoMessage()

func (*Agent) Reset

func (m *Agent) Reset()

func (*Agent) Size

func (m *Agent) Size() (n int)

func (*Agent) String

func (m *Agent) String() string

func (*Agent) Unmarshal

func (m *Agent) Unmarshal(dAtA []byte) error

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.

type Agents

type Agents struct {
	Agents []*Agent `protobuf:"bytes,1,rep,name=agents" json:"agents,omitempty"`
}

func QueryAgent

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

QueryAgent queries agent information in batches.

func (*Agents) Descriptor

func (*Agents) Descriptor() ([]byte, []int)

func (*Agents) GetAgents

func (m *Agents) GetAgents() []*Agent

func (*Agents) Marshal

func (m *Agents) Marshal() (dAtA []byte, err error)

func (*Agents) MarshalTo

func (m *Agents) MarshalTo(dAtA []byte) (int, error)

func (*Agents) ProtoMessage

func (*Agents) ProtoMessage()

func (*Agents) Reset

func (m *Agents) Reset()

func (*Agents) Size

func (m *Agents) Size() (n int)

func (*Agents) String

func (m *Agents) String() string

func (*Agents) Unmarshal

func (m *Agents) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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