onlinetable

package
v0.0.0-...-5dba8c9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2015 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

在线表模块

Index

Constants

View Source
const (
	ENTITY_TYPE_USER = iota
	ENTITY_TYPE_GROUP
)

实体类型定义

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	sync.RWMutex // 同步锁
	// contains filtered or unexported fields
}

在线表结构

func NewContainer

func NewContainer() *Container

func (*Container) AddEntity

func (ct *Container) AddEntity(uid string, pipe chan *message.Container) error

向在线表中添加实体

func (*Container) AddGroupEntity

func (ct *Container) AddGroupEntity(uid string, uidlist []string) error

向在线表中添加群组实体

func (*Container) DelEntity

func (ct *Container) DelEntity(uid string) error

通过UID删除实体

func (*Container) GetEntities

func (ct *Container) GetEntities() error

func (Container) GetEntity

func (ct Container) GetEntity(uid string) (*Entity, error)

通过UID获取实体

type Entity

type Entity struct {
	Uid       string
	Type      int
	Pipe      chan *message.Container
	List      []string
	LoginTime time.Time
}

实体结构

Jump to

Keyboard shortcuts

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