Documentation ¶
Index ¶
- Variables
- type Bundlable
- type IUserSvc
- type UserSvc
- func (h *UserSvc) Create(username string, password string) (string, error)
- func (h *UserSvc) FindBySub(sub string, user models.User) (*models.User, error)
- func (h *UserSvc) FindByUn(username string, user models.User) (*models.User, error)
- func (h *UserSvc) UsernameAvailable(username string) (bool, error)
- func (h *UserSvc) ValidatePassword(username string, password string, user models.User) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var FindBySubSql = `` /* 126-byte string literal not displayed */
View Source
var FindByUsernameSql = `
SELECT id, sub, username, created_at, updated_at, deleted_at
FROM users u
WHERE username = ?
`
View Source
var FindPasswordByUsernameSql = `
SELECT id, sub, username, password, created_at, updated_at, deleted_at
FROM users u
WHERE username = ?
`
View Source
var UserInsertSql = `
INSERT INTO users(username,password,id)
VALUES ( ?,?,UNHEX( REPLACE( ?,'-','' )));
`
View Source
var UsernameAvailableSql = `
SELECT COUNT(*) = 0
FROM (
SELECT 1
FROM users u
WHERE username = ?
LIMIT 1
) AS found;
`
Functions ¶
This section is empty.
Types ¶
type Bundlable ¶
type Bundlable struct{}
Bundlable adheres to Services.IBundlable and allows the service to be bundled
func (Bundlable) CreateService ¶
func (h Bundlable) CreateService(appCtx AppContext.Context) (interface{}, error)
CreateService is a copy-pasta property
func (Bundlable) ServiceName ¶
ServiceName Return the name of the service as it is defined in Services.Bundle
type IUserSvc ¶
type IUserSvc interface { Create(username string, password string) (string, error) FindByUn(username string, user models.User) (*models.User, error) FindBySub(sub string, user models.User) (*models.User, error) UsernameAvailable(username string) (bool, error) ValidatePassword(username string, password string, user models.User) (*models.User, error) }
type UserSvc ¶
type UserSvc struct {
AppCtx AppContext.Context
}
UserSvc adheres to IUserSvc
func (*UserSvc) UsernameAvailable ¶
Click to show internal directories.
Click to hide internal directories.