forked from GoIncremental/negroni-sessions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
31 lines (26 loc) · 803 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package dynamostore
import (
dynstore "github.com/denizeren/dynamostore"
nSessions "github.com/goincremental/negroni-sessions"
gSessions "github.com/gorilla/sessions"
)
//New returns a new Dynamodb store
func New(accessKey string, secretKey string, tableName string, region string, keyPairs ...[]byte) (nSessions.Store, error) {
store, err := dynstore.NewDynamoStore(accessKey, secretKey, tableName, region, keyPairs...)
if err != nil {
return nil, err
}
return &dynamoStore{store}, nil
}
type dynamoStore struct {
*dynstore.DynamoStore
}
func (c *dynamoStore) Options(options nSessions.Options) {
c.DynamoStore.Options = &gSessions.Options{
Path: options.Path,
Domain: options.Domain,
MaxAge: options.MaxAge,
Secure: options.Secure,
HttpOnly: options.HTTPOnly,
}
}