Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { ID string `json:"id"` UserID uint64 `json:"user_id"` CreateDate time.Time `json:"create_date"` }
Session is a user's session
type SessionHandler ¶
type SessionHandler struct {
// contains filtered or unexported fields
}
SessionHandler receives session-related functions, embedding the session database connection pool
func GetSessionHandler ¶
func GetSessionHandler() *SessionHandler
GetSessionHandler returns the initialize instance of the SessionHandler
func (*SessionHandler) GetUserID ¶
func (sess *SessionHandler) GetUserID(r *http.Request) uint64
GetUserID attempts to retrieve a User's ID form the Request's Session. Returns 0 if not found.
func (*SessionHandler) NewSession ¶
func (sess *SessionHandler) NewSession(w http.ResponseWriter, userID uint64) *Session
NewSession creates and stores a session cookie (sid)
Click to show internal directories.
Click to hide internal directories.