Documentation ¶
Overview ¶
Copyright 2017 Matt Ho
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Matt Ho ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type Option
- func Domain(v string) Option
- func DynamoDB(ddb *dynamodb.Client) Option
- func HTTPOnly() Option
- func MaxAge(v int) Option
- func Path(v string) Option
- func PrimaryKey(key string) Option
- func RefreshCookies() Option
- func Secure() Option
- func SessionOptions(options sessions.Options) Option
- func TableName(tableName string) Option
- type Store
- func (store *Store) Delete(ctx context.Context, id string) error
- func (store *Store) Get(req *http.Request, name string) (*sessions.Session, error)
- func (store *Store) Load(ctx context.Context, value string, session *sessions.Session) error
- func (store *Store) New(req *http.Request, name string) (*sessions.Session, error)
- func (store *Store) Persist(ctx context.Context, name string, session *sessions.Session) error
- func (store *Store) Save(req *http.Request, w http.ResponseWriter, session *sessions.Session) error
Constants ¶
const ( DefaultTableName = "sessions" DefaultPrimaryKey = "id" // DefaultTTLField contains the default name of the ttl field DefaultTTLField = "ttl" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Store)
Option provides options to creating a dynastore
func HTTPOnly ¶
func HTTPOnly() Option
HTTPOnly sets the default session option HttpOnly; HTTP is all capped to satisfy golint
func PrimaryKey ¶
func RefreshCookies ¶
func RefreshCookies() Option
func SessionOptions ¶
SessionOptions allows the default session options to be specified in a single command
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides an implementation of the gorilla sessions.Store interface backed by DynamoDB
func (*Store) Load ¶
load loads a session data from the database. True is returned if there is a session data in the database.
func (*Store) New ¶
New should create and return a new session.
Note that New should never return a nil session, even in the case of an error if using the Registry infrastructure to cache the session.