sessions

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSyncID

func GetSyncID(ctx context.Context) string

GetSyncID retrieves the sync ID from the context, returning empty string if not found.

func SetSyncIDInContext

func SetSyncIDInContext(ctx context.Context, syncID string) context.Context

Types

type SessionStore

type SessionStore interface {
	Get(ctx context.Context, key string, opt ...SessionStoreOption) ([]byte, bool, error)
	GetMany(ctx context.Context, keys []string, opt ...SessionStoreOption) (map[string][]byte, error)
	Set(ctx context.Context, key string, value []byte, opt ...SessionStoreOption) error
	SetMany(ctx context.Context, values map[string][]byte, opt ...SessionStoreOption) error
	Delete(ctx context.Context, key string, opt ...SessionStoreOption) error
	Clear(ctx context.Context, opt ...SessionStoreOption) error
	GetAll(ctx context.Context, pageToken string, opt ...SessionStoreOption) (map[string][]byte, string, error)
}

type SessionStoreBag

type SessionStoreBag struct {
	SyncID    string
	Prefix    string
	PageToken string
}

type SessionStoreConstructor

type SessionStoreConstructor func(ctx context.Context, opt ...SessionStoreConstructorOption) (SessionStore, error)

type SessionStoreConstructorOption

type SessionStoreConstructorOption func(ctx context.Context) (context.Context, error)

type SessionStoreKey

type SessionStoreKey struct{}

type SessionStoreOption

type SessionStoreOption func(ctx context.Context, bag *SessionStoreBag) error

func WithPageToken added in v0.5.3

func WithPageToken(pageToken string) SessionStoreOption

func WithPrefix added in v0.5.0

func WithPrefix(prefix string) SessionStoreOption

func WithSyncID

func WithSyncID(syncID string) SessionStoreOption

WithSyncID returns a SessionCacheOption that sets the sync ID for the operation.

type SetSessionStore added in v0.5.3

type SetSessionStore interface {
	SetSessionStore(ctx context.Context, store SessionStore)
}

type SyncIDKey

type SyncIDKey struct{}

SyncIDKey is the context key for storing the current sync ID.

Jump to

Keyboard shortcuts

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