Documentation ¶
Index ¶
- Variables
- func ComparePassword(hashedPass string, unhashedPass string) bool
- func CurrentUserID(r *http.Request, signingKey string) int
- func Delete(userID int) error
- func GenerateAdminUser(userName string, pass string) error
- func RegisterHandlers(mainConfig config.Configuration)
- func ValidateAdmin(next http.HandlerFunc) http.HandlerFunc
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Config config.Configuration
Config - used for access to config properties
Functions ¶
func ComparePassword ¶
ComparePassword encrypts and compares an existing password with a given one
func CurrentUserID ¶
CurrentUserID uses the auth token to return the current user's id
func GenerateAdminUser ¶
GenerateAdminUser creates an admin user record
func RegisterHandlers ¶
func RegisterHandlers(mainConfig config.Configuration)
RegisterHandlers - registers all user endpoints for the application
func ValidateAdmin ¶
func ValidateAdmin(next http.HandlerFunc) http.HandlerFunc
ValidateAdmin is middleware for validating whether or not the user is an admin user
Types ¶
type User ¶
type User struct { UserID int `json:"userID"` Login string `json:"login"` Password string `json:"password"` FirstName string `json:"firstName"` LastName string `json:"lastName"` IsAdmin bool `json:"isAdmin"` PasswordCanExpire bool `json:"passwordCanExpire"` IsDeleted bool `json:"isDeleted"` ExpireDate time.Time `json:"expireDate"` LastLogin time.Time `json:"lastLogin"` DateCreated time.Time `json:"dateCreated"` DateUpdated time.Time `json:"dateUpdated"` DateDeleted time.Time `json:"dateDeleted"` }
User - site user
func FetchUserByID ¶
FetchUserByID - looks for a record with a userID value that matches the one give. Returns an empty user if one is not found.
func FindExistingUser ¶
FindExistingUser finds a user record by their user propery
Click to show internal directories.
Click to hide internal directories.