Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(client redis.Cmdable, opts ...StoreOption) *Store
NewStore creates a new instance of the Store struct. It takes a redis.Cmdable client as the first argument and optional StoreOptions as the rest of the arguments. It returns a pointer to the created Store.
func (*Store) Generate ¶
Generate generates a new session in the store with the given ID. If a session with the same ID already exists, it returns an error. Otherwise, it creates a new session and returns it.
func (*Store) Get ¶
Get retrieves a session from the store based on the provided ID. If the session does not exist, it returns an error.
type StoreOption ¶
type StoreOption func(store *Store)
StoreOption is a function type for configuring a Store.
func WithExpiration ¶
func WithExpiration(expiration time.Duration) StoreOption
WithExpiration sets the expiration duration for the Store.
func WithPrefix ¶
func WithPrefix(prefix string) StoreOption
WithPrefix is a function that returns a StoreOption function. StoreOption is a function that modifies the behavior of the Store type. This function sets the prefix value of the store to the provided prefix parameter.