summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2013-11-15 10:15:45 +0400
committerKamil Kisiel <kamil@kamilkisiel.net>2013-11-15 10:15:45 +0400
commit65d3f02177b066fbe0c4682d5c01b1dbfab2947c (patch)
tree29bc131e993e4b9626b08c21e04b80eae627e8f2
parentebb83c42456610126ae4eb748e895fcdb6064782 (diff)
parent3cb09c3e9541606b194a45b02b85176b6e4635f4 (diff)
Merge pull request #19 from qedus/store_error_handling
Proposed change to Registry.Get function.
-rw-r--r--store.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/store.go b/store.go
index a5cb867..5eaea81 100644
--- a/store.go
+++ b/store.go
@@ -16,9 +16,19 @@ import (
)
// Store is an interface for custom session stores.
+//
+// See CookieStore and FilesystemStore for examples.
type Store interface {
+ // Get should return a cached session.
Get(r *http.Request, name string) (*Session, error)
+
+ // 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.
New(r *http.Request, name string) (*Session, error)
+
+ // Save should persist session to the underlying store implementation.
Save(r *http.Request, w http.ResponseWriter, s *Session) error
}