repository

package
v0.0.0-...-e74fef0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBRepository

type DBRepository interface {
	// User-related
	CreateUser(ctx context.Context, user *model.User) error
	IsUserExist(ctx context.Context, userIdType constant.UserIdType, userIdVal string) (isExist bool, err error)
	GetUserByOneOfIdentifier(ctx context.Context, val string) (user *model.User, err error)

	// Role-related
	BatchAssignRoles(ctx context.Context, userId uint64, roleIds []uint8) error

	// Device-related
	RegisterUserDevice(ctx context.Context, userDevice *model.UserDevice) error
}

func NewDB

func NewDB(db *sqlx.DB, config *model.AppConfig, logger *zap.Logger) DBRepository

type RedisRepository

type RedisRepository interface {
	RegisterUserDevice(ctx context.Context, deviceId string, token *model.Token) error
}

func NewRedis

func NewRedis(client *redis.Client, config *model.AppConfig, logger *zap.Logger) RedisRepository

Jump to

Keyboard shortcuts

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