stores

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenNotFound = errors.New("token not found")
)

Functions

This section is empty.

Types

type SessionStore

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

SessionStore implements in-memory session-based CSRF token storage

func NewSessionStore

func NewSessionStore() *SessionStore

NewSessionStore creates a new session-based token store

func (*SessionStore) Delete

func (s *SessionStore) Delete(id string) error

Delete removes a token

func (*SessionStore) Exists

func (s *SessionStore) Exists(id string) bool

Exists checks if a token exists and is not expired

func (*SessionStore) Get

func (s *SessionStore) Get(id string) (string, error)

Get retrieves a token for the given session ID

func (*SessionStore) Set

func (s *SessionStore) Set(id string, token string) error

Set stores a token for the given session ID

Jump to

Keyboard shortcuts

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