Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthNRepository ¶
type AuthNRepository interface { Blacklist(ctx context.Context, jti string, exp time.Duration) (bool, error) IsBlacklisted(ctx context.Context, jti string) bool }
func NewBasicAuthRepo ¶
func NewBasicAuthRepo(rdb *redis.Client) AuthNRepository
type BasicAuthRepo ¶
type BasicAuthRepo struct {
// contains filtered or unexported fields
}
func (*BasicAuthRepo) IsBlacklisted ¶
func (b *BasicAuthRepo) IsBlacklisted(ctx context.Context, jti string) bool
type UserRepository ¶
type UserRepository interface { CreateUser(ctx context.Context, name, email, hashedPswd string, role model.Role) (uint, error) ListUser(ctx context.Context, qp *dto.BasicQueryParam) ([]dto.GetAccountResponse, *dto.Page, error) ListAccountsByIDs(ctx context.Context, aids []uint, qp *dto.BasicQueryParam) ([]dto.GetAccountResponse, error) GetUserByEmail(ctx context.Context, email string) (model.User, error) GetUserByID(ctx context.Context, uid uint) (model.User, error) GetRoleByName(ctx context.Context, name string) (model.Role, error) UpdateUser(ctx context.Context, uid uint, user map[string]interface{}) error DeleteUser(ctx context.Context, uid uint) error CreateRole(ctx context.Context, name string) (int8, error) ListRole(ctx context.Context, qp *dto.BasicQueryParam) ([]model.Role, error) DeleteRole(ctx context.Context, rid int8) error }
UserRepository defines all the DB operations that the service supports
func NewBasicUserRepo ¶
func NewBasicUserRepo(db *gorm.DB) UserRepository
Click to show internal directories.
Click to hide internal directories.