repo

package
v0.0.0-...-aec1c34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Paginate

func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB

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) Blacklist

func (b *BasicAuthRepo) Blacklist(ctx context.Context, jti string, exp time.Duration) (bool, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL