Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
Credential represent the object holding our authentication data
type UserCollection ¶
type UserCollection interface {
// Create user in the database
CreateUser(u *UserObj) error
GetByUsername(username string) (UserObj, error)
GetAllUser() (*[]string, error)
Login(c Credential) (UserObj, error)
}
UserCollection holds function to manipulate the user collection
type UserObj ¶
type UserObj struct {
ID string `json:"id"`
Username string `json:"username"`
Password string `json:"password"`
}
UserObj An object represent user in database
type UserSession ¶
type UserSession interface {
SaveSession(username string) (string, error)
RetreiveSession(token string) (string, error)
DeleteSession(token string) (string, error)
SetCookie(w http.ResponseWriter, token string)
InsertUser(username string) error
RetreiveAllUsers() ([]string, error)
}
UserSession holds methods to use for session authentication
Click to show internal directories.
Click to hide internal directories.