memcachedstore

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prefix = "scs:session:"

Prefix controls the Memcached key prefix. You should only need to change this if there is a naming clash.

Functions

This section is empty.

Types

type MemcachedStore

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

func New

func New(client *memcache.Client) *MemcachedStore

New returns a new MemcachedStore instance. The conn parameter should be a pointer to a gomemcache connection pool.

func (*MemcachedStore) Delete

func (m *MemcachedStore) Delete(token string) error

Delete removes a session token and corresponding data from the MemcachedStore instance.

func (*MemcachedStore) Find

func (m *MemcachedStore) Find(token string) (b []byte, found bool, err error)

Find return the data for a session token from the MemcachedStore instance. If the session token is not found or is expired, the found return value is false (and the err return value is nil).

func (*MemcachedStore) Save

func (m *MemcachedStore) Save(token string, b []byte, expiry time.Time) error

Save adds a session token and data to the MemcachedStore instance with the given expiry time. If the session token already exists then the data and expiry time are updated.

Source Files

  • memcachedstore.go

Jump to

Keyboard shortcuts

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