Documentation ¶
Overview ¶
Package session provides a level of security for web tokens by giving them an expiration date and a lookup point for the user accessing the API. The session is what is used to look up the user performing the web call. Though the user's PublicID is not private, it is not used directly.
Index ¶
Constants ¶
View Source
const Collection = "auth_sessions"
Collection contains the name of the user collection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { ID bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"` SessionID string `bson:"session_id" json:"session_id"` PublicID string `bson:"public_id" json:"public_id"` DateExpires time.Time `bson:"date_expires" json:"date_expires"` DateCreated time.Time `bson:"date_created" json:"date_created"` }
Session denotes a user's session within the system.
func Create ¶
func Create(context interface{}, db *db.DB, publicID string, expires time.Duration) (*Session, error)
Create adds a new session for the specified user to the database.
func GetByLatest ¶
GetByLatest retrieves the latest session for the specified user.
func GetBySessionID ¶
GetBySessionID retrieves a session from the session store.
Click to show internal directories.
Click to hide internal directories.