session

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDMgr added in v0.7.0

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

func NewSessionIDMgr added in v0.7.0

func NewSessionIDMgr() *IDMgr

func (*IDMgr) Count added in v0.7.0

func (c *IDMgr) Count() int64

Count returns the connection numbers in current

func (*IDMgr) Decrement added in v0.7.0

func (c *IDMgr) Decrement()

Decrement the connection count

func (*IDMgr) Increment added in v0.7.0

func (c *IDMgr) Increment()

Increment the connection count

func (*IDMgr) Reset added in v0.7.0

func (c *IDMgr) Reset()

Reset the connection service status

func (*IDMgr) SessionID added in v0.7.0

func (c *IDMgr) SessionID() int64

SessionID returns the session id

type Session

type Session struct {
	sync.RWMutex // 数据锁
	// contains filtered or unexported fields
}

func NewSession

func NewSession(id int64) *Session

func (*Session) Attribute

func (s *Session) Attribute(key string) any

Attribute 获取指定key对应参数

func (*Session) Attributes

func (s *Session) Attributes() map[string]any

Attributes 获取所有参数

func (*Session) Bind

func (s *Session) Bind(uid string)

Bind 绑定uid

func (*Session) Close added in v0.7.0

func (s *Session) Close()

Close 关闭

func (*Session) Exists

func (s *Session) Exists(key string) bool

Exists 指定key是否存在

func (*Session) ID

func (s *Session) ID() int64

ID 获取 session ID

func (*Session) Invalidate

func (s *Session) Invalidate()

Invalidate 清理

func (*Session) Keys

func (s *Session) Keys() []string

Keys 获取所有参数key

func (*Session) RemoveAttribute

func (s *Session) RemoveAttribute(key string)

RemoveAttribute 移除指定key对应参数

func (*Session) SetAttribute

func (s *Session) SetAttribute(key string, value any)

SetAttribute 设置参数

func (*Session) UID

func (s *Session) UID() string

UID 获取UID

Jump to

Keyboard shortcuts

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