Documentation
¶
Overview ¶
Package session provides a session manager with TTL cleanup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory func(id string) *ProxySession
Factory defines a function type for creating new sessions.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager holds sessions with TTL cleanup.
func NewManager ¶
NewManager creates a session manager with TTL and starts cleanup worker.
func (*Manager) AddWithID ¶
AddWithID creates (and adds) a new session with the provided ID. Returns error if ID is empty or already exists.
type ProxySession ¶
type ProxySession struct {
// contains filtered or unexported fields
}
ProxySession implements the Session interface for proxy sessions.
func NewProxySession ¶
func NewProxySession(id string) *ProxySession
NewProxySession creates a new ProxySession with the given ID.
func (*ProxySession) CreatedAt ¶
func (s *ProxySession) CreatedAt() time.Time
CreatedAt returns the creation time of the session.
func (*ProxySession) Touch ¶
func (s *ProxySession) Touch()
Touch updates the session's last updated time to the current time.
func (*ProxySession) UpdatedAt ¶
func (s *ProxySession) UpdatedAt() time.Time
UpdatedAt returns the last updated time of the session.