user

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SHARD_COUNT = 32

Functions

func AddM added in v1.0.2

func AddM(key string, value interface{}) bool

func AddUser

func AddUser(key string, value UserConn) bool

func AllLen

func AllLen() int

func DeleteKey

func DeleteKey(key string)

func DeleteOUser

func DeleteOUser(key string, value UserConn)

func DeleteUser

func DeleteUser(key string, value UserConn) (bool, *time.Time)

func DeleteValue

func DeleteValue(value UserConn)

func GetALlKeyArray

func GetALlKeyArray() []string

func GetDelMS added in v1.0.2

func GetDelMS(key string) []interface{}

func GetKeyArray

func GetKeyArray(start int, num int) []string

func GetLen

func GetLen(key string) int

func GetUserAddtime

func GetUserAddtime(key string) *time.Time

Types

type Linklist struct {
	*list.List
	// contains filtered or unexported fields
}

func (*Linklist) Add added in v1.0.2

func (l *Linklist) Add(value UserConn)

func (*Linklist) AddM added in v1.0.2

func (l *Linklist) AddM(value interface{})

func (*Linklist) Contains added in v1.0.2

func (l *Linklist) Contains(value UserConn) (bool, *list.Element)

func (*Linklist) Delete added in v1.0.2

func (l *Linklist) Delete(value UserConn)

func (*Linklist) DeleteAll added in v1.0.2

func (l *Linklist) DeleteAll()

func (*Linklist) GetAllArray added in v1.0.2

func (l *Linklist) GetAllArray() []UserConn

func (*Linklist) GetArray added in v1.0.2

func (l *Linklist) GetArray(start int, num int) []UserConn

func (*Linklist) GetDelMS added in v1.0.2

func (l *Linklist) GetDelMS() []interface{}

func (*Linklist) GetLock added in v1.0.2

func (l *Linklist) GetLock() *sync.RWMutex

func (*Linklist) HasLocal added in v1.0.2

func (l *Linklist) HasLocal() bool

type Tuple

type Tuple struct {
	Key string
	Val interface{}
}

type User added in v1.0.2

type User struct {
	*Linklist

	UserId string
	// contains filtered or unexported fields
}

func GetUser added in v1.0.2

func GetUser(key string) *User

func GetValueArray added in v1.0.2

func GetValueArray(start int, num int) []*User

func NewUser added in v1.0.2

func NewUser(userId string) *User

func (*User) GetCreateTime added in v1.0.2

func (u *User) GetCreateTime() *time.Time

func (*User) GetUserConns added in v1.0.2

func (u *User) GetUserConns() []UserConn

func (*User) SendLocalMessage added in v1.0.2

func (u *User) SendLocalMessage(msg *message.Message) (int, error)

func (*User) SendMessage added in v1.0.2

func (u *User) SendMessage(msg *message.Message) (int, error)

type UserConn added in v1.0.2

type UserConn interface {
	SendMessage(*message.Message) (int, error)
	Close(userId string) error
	GetAddress() string
	IsLocal() bool
	GetType() string
	GetCreateTime() *time.Time
	GetUserId() string
}

func GetSetOneUser

func GetSetOneUser(key string, value UserConn) (UserConn, bool)

type UserExMap

type UserExMap []*userExMap

func NewUserExMap

func NewUserExMap() UserExMap

func (UserExMap) Add

func (m UserExMap) Add(key string, value UserConn) bool

func (UserExMap) AddM added in v1.0.2

func (m UserExMap) AddM(key string, value interface{}) bool

func (UserExMap) AllLen

func (m UserExMap) AllLen() int

func (UserExMap) Delete

func (m UserExMap) Delete(key string, value UserConn) (bool, *time.Time)

func (UserExMap) DeleteKey

func (m UserExMap) DeleteKey(key string)

func (UserExMap) DeleteOvalue

func (m UserExMap) DeleteOvalue(key string, value UserConn)

func (UserExMap) DeleteValue

func (m UserExMap) DeleteValue(value UserConn)

func (UserExMap) Get

func (m UserExMap) Get(key string) *User

func (UserExMap) GetALLKey

func (m UserExMap) GetALLKey() []string

func (UserExMap) GetALLValue

func (m UserExMap) GetALLValue() []*User

func (UserExMap) GetAddTime

func (m UserExMap) GetAddTime(key string) *time.Time

func (UserExMap) GetDelMS added in v1.0.2

func (m UserExMap) GetDelMS(key string) []interface{}

func (UserExMap) GetKeyArray

func (m UserExMap) GetKeyArray(start int, num int) []string

func (UserExMap) GetSetOneValue

func (m UserExMap) GetSetOneValue(key string, value UserConn) (UserConn, bool)

func (UserExMap) GetUserConns added in v1.0.2

func (m UserExMap) GetUserConns(key string) []UserConn

func (UserExMap) GetValueArray added in v1.0.2

func (m UserExMap) GetValueArray(start int, num int) []*User

func (UserExMap) IsHasKey

func (m UserExMap) IsHasKey(key string) bool

func (UserExMap) Items

func (m UserExMap) Items() map[string]interface{}

func (UserExMap) IterBuffered

func (m UserExMap) IterBuffered() <-chan Tuple

func (UserExMap) Len

func (m UserExMap) Len(key string) int

type UserLite added in v1.0.2

type UserLite struct {
	UserTCPConn
	LiveTime   int
	UserId     string
	CreateTime *time.Time
	Type       string
	Local      bool
}

func NewUserLite added in v1.0.2

func NewUserLite(conn UserTCPConn, LiveTime int, UserId string, CreateTime *time.Time, Type string, islocal bool) *UserLite

func (*UserLite) GetAddress added in v1.0.2

func (ul *UserLite) GetAddress() string

func (*UserLite) GetCreateTime added in v1.0.2

func (ul *UserLite) GetCreateTime() *time.Time

func (*UserLite) GetType added in v1.0.2

func (tcp *UserLite) GetType() string

func (*UserLite) GetUserId added in v1.0.2

func (ul *UserLite) GetUserId() string

func (*UserLite) IsLocal added in v1.0.2

func (tcp *UserLite) IsLocal() bool

type UserTCPConn added in v1.0.2

type UserTCPConn interface {
	Close() error
	RemoteAddr() net.Addr
	Write([]byte) (int, error)
	Read([]byte) (int, error)
	SetReadDeadline(time.Time) error
	SetDeadline(time.Time) error
}

Jump to

Keyboard shortcuts

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