scs: github.com/alexedwards/scs/stores/dynamostore Index | Files

package dynamostore

import "github.com/alexedwards/scs/stores/dynamostore"

Package dynamostore is a DynamoDB-based session store for the SCS session package.

The dynamostore package relis on the aws-sdk-go client. (https://godoc.org/github.com/aws/aws-sdk-go/service/dynamodb)

Index

Package Files

dynamostore.go

type DynamoStore Uses

type DynamoStore struct {
    DB *dynamodb.DynamoDB
    // contains filtered or unexported fields
}

DynamoStore represents the currently configured session session store. It is essentially a wrapper around a DynamoDB client. And table is a table name session stored. token, data, expiry are key names.

func New Uses

func New(dynamo *dynamodb.DynamoDB) *DynamoStore

New returns a new DynamoStore instance. The client parameter shoud be a pointer to a aws-sdk-go DynamoDB client. See https://godoc.org/github.com/aws/aws-sdk-go/service/dynamodb#DynamoDB.

func NewWithOption Uses

func NewWithOption(dynamo *dynamodb.DynamoDB, table string, token string, data string, expiry string, ttl string) *DynamoStore

NewWithOption returns a new DynamoStore instance. The client parameter shoud be a pointer to a aws-sdk-go DynamoDB client. See https://godoc.org/github.com/aws/aws-sdk-go/service/dynamodb#DynamoDB. The parameter table is DynamoDB tabel name, and token/data/expiry are key names.

func (*DynamoStore) DataName Uses

func (d *DynamoStore) DataName() string

DataName returns session data key name.

func (*DynamoStore) Delete Uses

func (d *DynamoStore) Delete(token string) error

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

func (*DynamoStore) ExpiryName Uses

func (d *DynamoStore) ExpiryName() string

ExpiryName returns session expiry key name.

func (*DynamoStore) Find Uses

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

Find returns the data for a given session token from the DynamoStore instance. If the session token is not found or is expired, the returned exists flag will be set to false.

func (*DynamoStore) Ping Uses

func (d *DynamoStore) Ping() error

Ping checks to exisit session table in DynamoDB.

func (*DynamoStore) Save Uses

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

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

func (*DynamoStore) TTLName Uses

func (d *DynamoStore) TTLName() string

TTLName returns session expiry key name.

func (*DynamoStore) TableName Uses

func (d *DynamoStore) TableName() string

TableName returns session table name.

func (*DynamoStore) TokenName Uses

func (d *DynamoStore) TokenName() string

TokenName returns session token key name.

Package dynamostore imports 4 packages (graph). Updated 2017-09-01. Refresh now. Tools for package owners.