Documentation
¶
Index ¶
- Constants
- Variables
- type Cache
- type FindGame
- type FindGameCache
- type Game
- type GameRepo
- type GameUseCase
- func (uc *GameUseCase) Create(ctx context.Context, item *Game) error
- func (uc *GameUseCase) Delete(ctx context.Context, ids ...uint64) error
- func (uc *GameUseCase) Find(ctx context.Context, condition *FindGame) (rp []Game)
- func (uc *GameUseCase) Get(ctx context.Context, id uint64) (rp *Game, err error)
- func (uc *GameUseCase) Update(ctx context.Context, item *UpdateGame) error
- type Transaction
- type UpdateGame
Constants ¶
View Source
const ( IdempotentMissingToken = "idempotent.token.missing" IdempotentTokenExpired = "idempotent.token.invalid" TooManyRequests = "too.many.requests" DataNotChange = "data.not.change" DuplicateField = "duplicate.field" RecordNotFound = "record.not.found" NoPermission = "no.permission" )
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewGameUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Cache is get redis instance
Cache() redis.UniversalClient
// WithPrefix will add cache key prefix
WithPrefix(prefix string) Cache
// Get is get cache data by key from redis, do write handler if cache is empty
Get(ctx context.Context, action string, write func(context.Context) (string, bool)) (string, bool)
// Set is set data to redis
Set(ctx context.Context, action, data string, short bool)
// Del delete key
Del(ctx context.Context, action string)
// SetWithExpiration is set data to redis with custom expiration
SetWithExpiration(ctx context.Context, action, data string, seconds int64)
// Flush is clean association cache if handler err=nil
Flush(ctx context.Context, handler func(context.Context) error) error
}
type FindGameCache ¶ added in v1.0.2
type GameUseCase ¶ added in v1.0.2
type GameUseCase struct {
// contains filtered or unexported fields
}
func NewGameUseCase ¶ added in v1.0.2
func NewGameUseCase(c *conf.Bootstrap, repo GameRepo, tx Transaction, cache Cache) *GameUseCase
func (*GameUseCase) Create ¶ added in v1.0.2
func (uc *GameUseCase) Create(ctx context.Context, item *Game) error
func (*GameUseCase) Delete ¶ added in v1.0.2
func (uc *GameUseCase) Delete(ctx context.Context, ids ...uint64) error
func (*GameUseCase) Find ¶ added in v1.0.2
func (uc *GameUseCase) Find(ctx context.Context, condition *FindGame) (rp []Game)
func (*GameUseCase) Update ¶ added in v1.0.2
func (uc *GameUseCase) Update(ctx context.Context, item *UpdateGame) error
type Transaction ¶
type UpdateGame ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.