Documentation ¶
Index ¶
- Constants
- type DynamodbStore
- func (s *DynamodbStore) CreateTable(readCapacityUnits, writeCapacityUnits int64) error
- func (s *DynamodbStore) DropTable() error
- func (s *DynamodbStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *DynamodbStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *DynamodbStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- type Option
- type StoreOptions
Constants ¶
const DefaultSessionExpire = 86400 * 30
DefaultSessionExpire expiry time in seconds for cookies/dynamodb keys to expire
const DefaultTableName = "SessionTable"
DefaultTableName default dynamodb session table name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamodbStore ¶
type DynamodbStore struct { DB *dynamodb.DynamoDB TableName string Codecs []securecookie.Codec Options *sessions.Options // default configuration DefaultMaxAge int // default Redis TTL for a MaxAge == 0 session // contains filtered or unexported fields }
DynamodbStore stores sessions in a dynamodb backend.
func NewDynamodbStore ¶
func NewDynamodbStore(ddb *dynamodb.DynamoDB, keyPairs ...[]byte) (*DynamodbStore, error)
NewDynamodbStore create a new store using the supplied DynamoDB session
func NewDynamodbStoreWithOptions ¶ added in v1.1.0
func NewDynamodbStoreWithOptions(ddb *dynamodb.DynamoDB, options ...Option) *DynamodbStore
NewDynamodbStoreWithOptions new dynamodb session store using options
func (*DynamodbStore) CreateTable ¶
func (s *DynamodbStore) CreateTable(readCapacityUnits, writeCapacityUnits int64) error
CreateTable setup a new table for session records using the configured table name
func (*DynamodbStore) DropTable ¶
func (s *DynamodbStore) DropTable() error
DropTable delete table for session records using the configured table name
func (*DynamodbStore) Get ¶
Get returns a session for the given name after adding it to the registry.
See gorilla/sessions FilesystemStore.Get().
func (*DynamodbStore) New ¶
New returns a session for the given name without adding it to the registry.
See gorilla/sessions FilesystemStore.New().
func (*DynamodbStore) Save ¶
func (s *DynamodbStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save adds a single session to the response.
type Option ¶ added in v1.1.0
type Option func(opts *StoreOptions)
Option used to configure the store
func DefaultMaxAge ¶ added in v1.1.0
DefaultMaxAge update the default max age provided to github.com/gorilla/sessions
func KeyPairs ¶ added in v1.1.0
KeyPairs update the key pairs provided to github.com/gorilla/sessions
func SessionOptions ¶ added in v1.1.0
SessionOptions update the session options provided to github.com/gorilla/sessions
type StoreOptions ¶ added in v1.1.0
type StoreOptions struct {
// contains filtered or unexported fields
}
StoreOptions used to configure the dynamodb session store