Documentation ¶
Index ¶
- Constants
- type User
- type UserItemsStatsRepoSqlite3
- type UserItemsStatsRepositoryInterface
- type UserRepoSqlite3
- type UserRepositoryInterface
- type Users
- func (ua *Users) AdminSet(userId uint32) (User, error)
- func (ua *Users) AdminUnset(userId uint32) (User, error)
- func (ua *Users) ChangePassword(userId uint32, oldPassword string, newPassword string, ...) (User, error)
- func (ua *Users) CreateUser(username string, password string, passwordRepeat string, isAdmin int32) (User, error)
- func (ua *Users) DeleteUser(userID uint32) (User, error)
- func (ua *Users) GetUser(userId uint32) (User, error)
- func (ua *Users) IsPasswordValid(username string, password string) (User, error)
- func (ua *Users) ListUsers() ([]User, error)
- func (ua *Users) SetPassword(userId uint32, newPassword string, newPasswordRepeat string) (User, error)
Constants ¶
View Source
const ERROR_CREATE_USER_USERNAME_ALREADY_TAKEN = "Username already taken"
View Source
const ERROR_INVALID_USERNAME_OR_PASSWORD = "Invalid username or password"
View Source
const ERROR_PASSWORDS_DO_NOT_MATCH = "Passwords do not match"
View Source
const ERROR_UNKNOWN_USER = "Unknown user"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID uint32 Username string Password string Credits int32 // contains filtered or unexported fields }
Represenation of a Matomat users properties, currently only an ID and the Credits (in currency cents).
type UserItemsStatsRepoSqlite3 ¶
type UserItemsStatsRepoSqlite3 struct {
// contains filtered or unexported fields
}
func NewUserItemsStatsRepoSqlite3 ¶
func NewUserItemsStatsRepoSqlite3(sqlite3DbFilePath string) *UserItemsStatsRepoSqlite3
func (*UserItemsStatsRepoSqlite3) CountConsumption ¶
func (r *UserItemsStatsRepoSqlite3) CountConsumption(userID uint32, itemID uint32, consumed uint32) error
type UserRepoSqlite3 ¶
type UserRepoSqlite3 struct {
// contains filtered or unexported fields
}
func NewUserRepoSqlite3 ¶
func NewUserRepoSqlite3(sqlite3DbFilePath string) *UserRepoSqlite3
func (*UserRepoSqlite3) GetByUsername ¶
func (r *UserRepoSqlite3) GetByUsername(username string) (User, error)
func (*UserRepoSqlite3) List ¶
func (r *UserRepoSqlite3) List() ([]User, error)
type UserRepositoryInterface ¶
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func NewUsers ¶
func NewUsers(userRepo UserRepositoryInterface, passwordHashingCost int) *Users
func (*Users) ChangePassword ¶
func (*Users) CreateUser ¶
func (*Users) IsPasswordValid ¶
Click to show internal directories.
Click to hide internal directories.