Documentation
¶
Index ¶
- Constants
- func CreateSessionHandlerFunc(sessionUpdater SessionUpdater, cache Cache) http.HandlerFunc
- func DeleteAllSessionsHandlerFunc(cache Cache) http.HandlerFunc
- func GetByIDSessionHandlerFunc(cache Cache, getVarsFunc GetVarsFunc) http.HandlerFunc
- type API
- type AuthHandler
- type Cache
- type GetVarsFunc
- type NOPCache
- type NOPSession
- type SessionUpdater
Constants ¶
View Source
const ( NOPSessionID = "123" NOPStart = "Mon Jan _2 15:04:05 2006" )
Variables ¶
This section is empty.
Functions ¶
func CreateSessionHandlerFunc ¶ added in v0.2.0
func CreateSessionHandlerFunc(sessionUpdater SessionUpdater, cache Cache) http.HandlerFunc
CreateSessionHandlerFunc returns a function that generates a session. Method = "POST"
func DeleteAllSessionsHandlerFunc ¶ added in v0.2.0
func DeleteAllSessionsHandlerFunc(cache Cache) http.HandlerFunc
func GetByIDSessionHandlerFunc ¶ added in v0.2.0
func GetByIDSessionHandlerFunc(cache Cache, getVarsFunc GetVarsFunc) http.HandlerFunc
GetByIDSessionHandlerFunc returns a function that retrieves a session by ID from the cache
Types ¶
type AuthHandler ¶ added in v0.2.0
type AuthHandler interface {
Require(required auth.Permissions, handler http.HandlerFunc) http.HandlerFunc
}
AuthHandler interface for adding auth to endpoints
type Cache ¶ added in v0.2.0
type Cache interface {
Set(s *session.Session) error
GetByID(ID string) (*session.Session, error)
DeleteAll() error
}
Cache interface for storing and retrieving sessions
type GetVarsFunc ¶ added in v0.2.0
GetVarsFunc is a helper function that returns a map of request variables and parameters
type NOPCache ¶ added in v0.2.0
type NOPCache struct{}
NOPCache no-op struct
Click to show internal directories.
Click to hide internal directories.