card

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRedisRepository

type IRedisRepository interface {
	GetByID(ctx context.Context, id uint) (string, error)
}

func NewRedisRepository

func NewRedisRepository(redisConn *redis.Client) IRedisRepository

type IRepository

type IRepository interface {
	GetByID(ctx context.Context, id uint) (domain.Card, error)
}

func NewRepository

func NewRepository(dbConn *gorm.DB) IRepository

type IUseCase

type IUseCase interface {
	GetByID(ctx context.Context, id uint) (domain.Card, error)
}

func NewUseCase

func NewUseCase(repo IRepository, redis IRedisRepository) IUseCase

type RedisRepository

type RedisRepository struct {
	RedisConn *redis.Client // RedisConn is the redis connection.
}

func (RedisRepository) GetByID

func (r RedisRepository) GetByID(ctx context.Context, id uint) (string, error)

type SQLRepository

type SQLRepository struct {
	DBConn *gorm.DB
}

func (SQLRepository) GetByID

func (r SQLRepository) GetByID(ctx context.Context, id uint) (domain.Card, error)

type UseCase

type UseCase struct {
	IRepository
	IRedisRepository
}

func (*UseCase) GetByID

func (*UseCase) GetByID(_ context.Context, _ uint) (domain.Card, error)

Jump to

Keyboard shortcuts

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