Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SessionIDHashKeyName is the DynamoDB partition key attribute name for the session ID. SessionIDHashKeyName = "session_id" // SessionDataKeyName is the attribute name for the gob-encoded session data (stored as Binary). SessionDataKeyName = "session_data" // SessionExpiresName is the attribute name for the session expiration Unix time (stored as Number). SessionExpiresName = "session_expires_at" )
These attribute names must match the values used by v1 so that existing tables and session items remain compatible after upgrading.
Variables ¶
View Source
var DefaultSessionOptions = &gsessions.Options{
Path: "/",
MaxAge: 86400 * 30,
}
Functions ¶
This section is empty.
Types ¶
type DynamoDBAPI ¶
type DynamoDBAPI interface {
GetItem(ctx context.Context, in *awsdynamodb.GetItemInput, opts ...func(*awsdynamodb.Options)) (*awsdynamodb.GetItemOutput, error)
PutItem(ctx context.Context, in *awsdynamodb.PutItemInput, opts ...func(*awsdynamodb.Options)) (*awsdynamodb.PutItemOutput, error)
DeleteItem(ctx context.Context, in *awsdynamodb.DeleteItemInput, opts ...func(*awsdynamodb.Options)) (*awsdynamodb.DeleteItemOutput, error)
}
DynamoDBAPI is the minimal interface satisfied by *dynamodb.Client from aws-sdk-go-v2.
type Store ¶
type Store interface {
ginsessions.Store
}
Store is the public interface returned by NewStore.
func NewStore ¶
func NewStore(client DynamoDBAPI, tableName string, keyPairs ...[]byte) Store
NewStore creates a new DynamoDB-backed session store. client must satisfy DynamoDBAPI (e.g. *dynamodb.Client from aws-sdk-go-v2). keyPairs follow the same convention as gorilla/securecookie: pairs of authentication key (required) and optional encryption key.
Click to show internal directories.
Click to hide internal directories.