Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLackOfInfor = errors.New("lack of information")
Functions ¶
Types ¶
type AccountAccessor ¶
type AccountAccessor interface {
CreateAccount(ctx context.Context, account Account) (uint64, error)
GetAccount(ctx context.Context, id uint64) (Account, error)
GetAccountByUsername(ctx context.Context, username string) (Account, error)
UpdateAccount(ctx context.Context, account Account) error
DeleteAccount(ctx context.Context, id uint64) error
DeleteAccountByUsername(ctx context.Context, username string) error
IsUsernameTaken(ctx context.Context, username string) (bool, error)
GetAccountAll(ctx context.Context) ([]Account, error)
GetAccountList(ctx context.Context, ids []uint64) ([]Account, error)
WithExecutor(exec Executor) AccountAccessor
}
func NewAccountAccessor ¶
func NewAccountAccessor( exec Executor, logger *zap.Logger, ) AccountAccessor
type AccountPassword ¶
type AccountPasswordAccessor ¶
type AccountPasswordAccessor interface {
CreateAccountPassword(ctx context.Context, ap AccountPassword) error
GetAccountPassword(ctx context.Context, id uint64) (AccountPassword, error)
UpdateAccountPassword(ctx context.Context, ap AccountPassword) error
DeleteAccountPassword(ctx context.Context, id uint64) error
WithExecutor(exec Executor) AccountPasswordAccessor
}
func NewAccountPasswordAccessor ¶
func NewAccountPasswordAccessor( exec Executor, logger *zap.Logger, ) AccountPasswordAccessor
type AccountRole ¶
type AccountRoleAccessor ¶
type AccountRoleAccessor interface {
GetRoleById(ctx context.Context, id uint8) (AccountRole, error)
GetRoleByName(ctx context.Context, name string) (AccountRole, error)
WithExecutor(exec Executor) AccountRoleAccessor
}
func NewAccountRoleAccessor ¶
func NewAccountRoleAccessor( exec Executor, logger *zap.Logger, ) AccountRoleAccessor
type Executor ¶
type Executor interface {
Exec(query string, args ...any) (sql.Result, error)
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
Query(query string, args ...any) (*sql.Rows, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
Prepare(query string) (*sql.Stmt, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
}
Click to show internal directories.
Click to hide internal directories.