domain

package
v0.0.0-...-ac94473 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionNotFound = fmt.Errorf("session not found")
)

Functions

This section is empty.

Types

type Session

type Session struct {
	ID        string
	Data      map[string]interface{}
	CreatedAt time.Time
	ActiveAt  time.Time
}

Session 会话实体对象

func NewSession

func NewSession(id string) *Session

NewSession 创建新的 Session 实体对象

func (*Session) UpdateLastActiveTime

func (s *Session) UpdateLastActiveTime()

UpdateLastActiveTime 更新会话的最后活跃时间

type SessionContextKey

type SessionContextKey struct {
}

type SessionRepository

type SessionRepository interface {
	Get(id string) (*Session, error)
	Set(session *Session) error
	Delete(id string) error
	Len() int
	PeekOldest() (*Session, error)
}

SessionRepository 会话仓储接口定义

Jump to

Keyboard shortcuts

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