Documentation
¶
Index ¶
- Variables
- type Game
- type GameRepo
- type GameUseCase
- func (uc *GameUseCase) Create(ctx context.Context, u *Game) (*Game, error)
- func (uc *GameUseCase) Get(ctx context.Context, id int64) (*Game, error)
- func (uc *GameUseCase) List(ctx context.Context, pageNum, pageSize int64) ([]*Game, error)
- func (uc *GameUseCase) Update(ctx context.Context, u *Game) (*Game, error)
- type Image
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewGameUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type GameRepo ¶
type GameRepo interface {
// db
// read from db if cache miss
GetGame(ctx context.Context, id int64) (*Game, error)
ListGame(ctx context.Context, pageNum, pageSize int64) ([]*Game, error)
CreateGame(ctx context.Context, c *Game) (*Game, error)
UpdateGame(ctx context.Context, c *Game) (*Game, error)
// redis
// read from Redis. if cache miss, read from db and create backfill job
CacheGetGame(ctx context.Context, id int64) (*Game, error)
CacheListGame(ctx context.Context, pageNum int64, pageSize int64) ([]*Game, error)
CacheCreateGame(ctx context.Context, c *Game) (*Game, error)
CacheUpdateGame(ctx context.Context, c *Game) (*Game, error)
// kafka
// Create, update & backfill will be handled by catalog-job
KafkaCreateGame(ctx context.Context, c *Game) (*Game, error)
KafkaUpdateGame(ctx context.Context, c *Game) (*Game, error)
KafkaBackfillGame(ctx context.Context, Id int64) error
KafkaBackfillListGame(ctx context.Context, pageNum int64, pageSize int64) error
}
type GameUseCase ¶
type GameUseCase struct {
// contains filtered or unexported fields
}
func NewGameUseCase ¶
func NewGameUseCase(repo GameRepo, logger log.Logger) *GameUseCase
Click to show internal directories.
Click to hide internal directories.