Documentation
¶
Index ¶
- Variables
- func NewDecoder() *form.Decoder
- type Argon2Params
- type Control
- type CurrentUserPageViewModel
- type DeleteUserPageViewModel
- type ListUsersPageViewModel
- type ListUsersQuery
- type LocalAuthRepo
- type LocalAuthRepoSQLite
- func (*LocalAuthRepoSQLite) CreateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) (*LocalAuthUser, error)
- func (*LocalAuthRepoSQLite) DeleteByUsername(ctx context.Context, tx bob.Executor, username string) error
- func (*LocalAuthRepoSQLite) GetLocalUser(ctx context.Context, tx bob.Executor, username string) (*LocalAuthUser, error)
- func (*LocalAuthRepoSQLite) UpdateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) error
- type LocalAuthUser
- type NewUserPageViewModel
- type ResetPasswordPageViewModel
- type UIRouter
- type User
- type UserListPage
- type UserRepo
- type UserRepoSQLite
- func (*UserRepoSQLite) CountAdmins(ctx context.Context, tx bob.Executor) (int64, error)
- func (*UserRepoSQLite) Create(ctx context.Context, tx bob.Executor, toCreate *User) (*User, error)
- func (*UserRepoSQLite) Delete(ctx context.Context, tx bob.Executor, id int64) error
- func (*UserRepoSQLite) Get(ctx context.Context, tx bob.Executor, id int64) (*User, error)
- func (*UserRepoSQLite) GetByRef(ctx context.Context, tx bob.Executor, ref string) (*User, error)
- func (*UserRepoSQLite) List(ctx context.Context, exec bob.Executor, query ListUsersQuery) (*UserListPage, error)
- func (*UserRepoSQLite) Update(ctx context.Context, tx bob.Executor, toUpdate *User) (*User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidCredentials = errors.New("invalid credentials")
View Source
var ErrLocalAuthUserNotFound = errors.New("user for local auth not found")
View Source
var ErrPasswordEmpty = errors.New("password must not be empty")
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var ErrUsernameEmpty = errors.New("username must not be empty")
Functions ¶
func NewDecoder ¶
Types ¶
type Argon2Params ¶
type Control ¶
type Control struct {
DB *database.Database
UserRepo UserRepo
LocalAuthRepo LocalAuthRepo
Argon2Params Argon2Params
}
type DeleteUserPageViewModel ¶
type DeleteUserPageViewModel struct {
User *User
}
type ListUsersPageViewModel ¶
type ListUsersPageViewModel struct {
Page *UserListPage
Query ListUsersQuery
Compact bool
}
type ListUsersQuery ¶
type LocalAuthRepo ¶
type LocalAuthRepo interface {
GetLocalUser(ctx context.Context, tx bob.Executor, username string) (*LocalAuthUser, error)
CreateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) (*LocalAuthUser, error)
UpdateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) error
DeleteByUsername(ctx context.Context, tx bob.Executor, username string) error
}
type LocalAuthRepoSQLite ¶
type LocalAuthRepoSQLite struct{}
func (*LocalAuthRepoSQLite) CreateLocalUser ¶
func (*LocalAuthRepoSQLite) CreateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) (*LocalAuthUser, error)
func (*LocalAuthRepoSQLite) DeleteByUsername ¶
func (*LocalAuthRepoSQLite) GetLocalUser ¶
func (*LocalAuthRepoSQLite) GetLocalUser(ctx context.Context, tx bob.Executor, username string) (*LocalAuthUser, error)
func (*LocalAuthRepoSQLite) UpdateLocalUser ¶
func (*LocalAuthRepoSQLite) UpdateLocalUser(ctx context.Context, tx bob.Executor, user *LocalAuthUser) error
type LocalAuthUser ¶
type NewUserPageViewModel ¶
type UIRouter ¶
func (*UIRouter) RegisterRoutes ¶
type UserListPage ¶
type UserRepo ¶
type UserRepo interface {
List(ctx context.Context, exec bob.Executor, query ListUsersQuery) (*UserListPage, error)
Create(ctx context.Context, tx bob.Executor, toCreate *User) (*User, error)
Update(ctx context.Context, tx bob.Executor, toUpdate *User) (*User, error)
Get(ctx context.Context, tx bob.Executor, id int64) (*User, error)
GetByRef(ctx context.Context, tx bob.Executor, ref string) (*User, error)
CountAdmins(ctx context.Context, tx bob.Executor) (int64, error)
Delete(ctx context.Context, tx bob.Executor, id int64) error
}
type UserRepoSQLite ¶
type UserRepoSQLite struct{}
func (*UserRepoSQLite) CountAdmins ¶
func (*UserRepoSQLite) List ¶
func (*UserRepoSQLite) List(ctx context.Context, exec bob.Executor, query ListUsersQuery) (*UserListPage, error)
Click to show internal directories.
Click to hide internal directories.