Documentation
¶
Index ¶
- func AddSettings() (*uuid.UUID, error)
- func AddUser(name string, email string, passwd string) error
- func BootstrapSystem() error
- func CheckEmailAndPassword(email string, password string) error
- func ConnectSystem() (*sql.DB, error)
- func DeleteSettings(settingsID *uuid.UUID) error
- func DeleteUser(email string) error
- func EmailExists(email string) (bool, error)
- func GetUserCount() (int, error)
- func UserExists(username string) (bool, error)
- type User
- type UserSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSettings ¶
func AddUser ¶
AddUser creates a new user entry in the DB. Whitespaces in the email are automatically deleted Email is a unique attribute, so the function checks for existing email, before adding a new entry
func BootstrapSystem ¶
func BootstrapSystem() error
func CheckEmailAndPassword ¶
CheckPassword compares the password entered by the user with the stored password.
func ConnectSystem ¶
func DeleteSettings ¶
func DeleteUser ¶
func EmailExists ¶
func GetUserCount ¶
func UserExists ¶
Types ¶
type User ¶
type User struct { ID uuid.UUID `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` SettingsID uuid.UUID `json:"user_settings_id,omitempty"` }
User defines the user structures. Each user must have an associated settings entry.
func GetUserByEmail ¶
GetUserByEmail returns the user defined by the email and password.
type UserSettings ¶
type UserSettings struct { ID uuid.UUID `json:"id,omitempty"` Enable2StepsVerif bool `json:"two_steps_verif,omitempty"` }
func GetSettings ¶
func GetSettings(settingsID *uuid.UUID) (*UserSettings, error)
Click to show internal directories.
Click to hide internal directories.