session

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	Path     string
	Domain   string
	SameSite string
	MaxAge   *int
	HttpOnly bool

	Secure bool
	// contains filtered or unexported fields
}

func NewCookie

func NewCookie(options *Cookie) Cookie

func (*Cookie) GetData

func (c *Cookie) GetData() CookieData

func (*Cookie) GetExpires

func (c *Cookie) GetExpires() int64

GetExpires returns the expiration time of the cookie

func (*Cookie) GetMaxAge

func (c *Cookie) GetMaxAge() int64

func (*Cookie) SetExpires

func (c *Cookie) SetExpires(expires time.Time)

SetExpires sets the max age of the cookie

func (*Cookie) SetMaxAge

func (c *Cookie) SetMaxAge(ms *int64)

type CookieData

type CookieData struct {
	OriginalMaxAge *int64
	Expires        *int64
	Secure         bool
	HttpOnly       bool
	Domain         string
	Path           string
	SameSite       string
}

type Database

type Database struct {
}

func NewSessionDatabase

func NewSessionDatabase(db *db.DataStore) Database

func (Database) Close

func (s Database) Close() error

func (Database) Delete

func (s Database) Delete(key string) error

func (Database) Get

func (s Database) Get(key string) ([]byte, error)

func (Database) Reset

func (s Database) Reset() error

func (Database) Set

func (s Database) Set(key string, val []byte, exp time.Duration) error

type Expiration

type Expiration struct {
	Timeout *time.Timer
	Db      *int64
	Real    *int64
}

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(db db.DataStore, refresh *int64) *MemoryStore

func (*MemoryStore) Destroy

func (m *MemoryStore) Destroy(sid string) *session.Session

func (*MemoryStore) Get

func (m *MemoryStore) Get(sid string) *session.Session

func (*MemoryStore) Set

func (m *MemoryStore) Set(sid *string, session *session.Session)

func (*MemoryStore) ShutDown

func (m *MemoryStore) ShutDown()

func (*MemoryStore) Shutdown

func (m *MemoryStore) Shutdown()

func (*MemoryStore) Touch

func (m *MemoryStore) Touch(sid string, session *session.Session)

func (*MemoryStore) UpdateExpirations

func (m *MemoryStore) UpdateExpirations(sid *string, session *session.Session, updateDbExp *bool) *session.Session

func (*MemoryStore) Write

func (m *MemoryStore) Write(sid string, session session.Session)

Jump to

Keyboard shortcuts

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