session

package
v0.0.0-...-f6d4ea8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STypePerson = 1
	STypeGroup  = 2
	STypeRoom   = 3
)
View Source
const (
	CollectionName = "session"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Id       primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	AppId    string             `bson:"appId" json:"app_id"`
	UserId   string             `bson:"userId" json:"user_id"`
	Type     int                `bson:"type" json:"type"`
	TargetId string             `bson:"targetId" json:"target_id"`
	UTime    time.Time          `bson:"utime" json:"utime"`
	CTime    time.Time          `bson:"ctime" json:"ctime"`
}

func FindUserSessions

func FindUserSessions(appId, userId string, n int) ([]*Session, error)

查询用户会话记录

func UpsertSession

func UpsertSession(appId, userId string, stype int, targetId string) (*Session, error)

更新用户会话

func (*Session) TableName

func (*Session) TableName() string

Jump to

Keyboard shortcuts

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