Documentation ¶
Index ¶
Constants ¶
const DefaultTableName = "scs.session"
DefaultTableName is used when a more specific name isn't provided.
Variables ¶
var ErrCreateTimedOut = errors.New("timed out waiting for table creation")
ErrCreateTimedOut is returned when table creation takes too long.
var ErrDeleteInProgress = errors.New("table deletion in progress")
ErrDeleteInProgress is returned when table creation fails because a table with the same name was recently deleted.
Functions ¶
This section is empty.
Types ¶
type DynamoStore ¶
type DynamoStore struct {
// contains filtered or unexported fields
}
DynamoStore represents the session store.
func New ¶
func New(svc *dynamodb.Client) *DynamoStore
New creates a DynamoStore instance using default values.
func NewWithTableName ¶
func NewWithTableName(svc *dynamodb.Client, table string) *DynamoStore
NewWithTableName create a DynamoStore instance, overriding the default table name.
func (*DynamoStore) Commit ¶
Commit adds a session token and data to the DynamoStore instance with the given expiry time. If the session token already exists then the data and expiry time are updated.
func (*DynamoStore) CreateTable ¶
func (s *DynamoStore) CreateTable() error
CreateTable creates the session store table, if it doesn't already exist. This is only intended as a convenience function to make development and testing easier. It is not intended for use in production.
func (*DynamoStore) Delete ¶
func (s *DynamoStore) Delete(token string) error
Delete removes a session token and corresponding data from the DynamoStore instance.