Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func HashPassword ¶
Types ¶
type Session ¶
type Session struct { UserAgent string `json:"user_agent" db:"user_agent"` ID string `json:"id" db:"id"` UserID string `json:"user_id" db:"user_id"` TokenHash string `json:"-" db:"token_hash"` ExpiresAt *time.Time `json:"expires_at" db:"expires_at"` CreatedAt time.Time `json:"created_at" db:"created_at"` LastUsed *time.Time `json:"last_used" db:"last_used"` }
type Store ¶
type Store interface { Authenticate(username, password string) (*User, error) CreateUser(username, password string) (*User, error) GetUserByUsername(username string) (*User, error) GetUserByID(userID string) (*User, error) CreateSession(userAgent, userID, tokenHash string) (*Session, error) GetSession(id string) (*Session, error) GetSessionByHash(tokenHash string) (*Session, error) UpdateSessionLastUsed(sessionID string) error DeleteSession(sessionID string) error IsSessionExpired(session *Session) bool }
Click to show internal directories.
Click to hide internal directories.