domain

package
v0.0.0-...-2b0c82f Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorMsgDecode = errors.New("event msg decode error")
	ErrorEventDone = errors.New("event had been done")

	ErrorInternalRedis = errors.New("internal redis error")

	ErrorNoEnoughAsset             = errors.New("asset not enough")
	ErrorSetAssetFromCBTimeOut     = errors.New("set asset from db exec timeout")
	ErrorSetAssetDoneOut           = errors.New("set asset from db exec done out")
	ErrorWatchAssetCasLoopMaxRetry = errors.New("watch user asset CAS loop reached maximum number of retries")

	ErrorSendAssetChangeEventMsg = errors.New("send user asset change event msg fail")
)

Functions

This section is empty.

Types

type AssetIncrHandler

type AssetIncrHandler func(ctx context.Context) (incrAssetCn int64)

type IUserAssetCallBack

type IUserAssetCallBack interface {
	GetAssets(ctx context.Context, userIds []int64) (assetDtos []*base.UserAsset, err error)
	SetAsset(ctx context.Context, userId int64, assetType base.AssetType) (err error)
}

type IUserAssetEventMsgListener

type IUserAssetEventMsgListener interface {
	primitive.TransactionListener
}

type IUserAssetEventMsgRepository

type IUserAssetEventMsgRepository interface {
	SendUserAssetChangeMsgTx(ctx context.Context, topicName, tagName string, userId int64, eventMsg *station.BizEventAssetChange, handler primitive.TxHandler) error
}

type IUserAssetEventRepository

type IUserAssetEventRepository interface {
	UserAssetChangeTx(ctx context.Context, eventId string, changeInfo *station.UserAssetChangeInfo, handle AssetIncrHandler) (*base.UserAsset, error)
	GetUserAssetEventMsg(ctx context.Context, userId int64, eventId string) (int, error)
}

type IUserAssetEventUseCase

type IUserAssetEventUseCase interface {
	UserAssetChangeTx(ctx context.Context, opUserType int, event *station.BizEventAssetChange, handle AssetIncrHandler) (*base.UserAsset, error)
}

type IUserAssetRepository

type IUserAssetRepository interface {
	GetAsset(ctx context.Context, key string) (assetObj *base.UserAsset, err error)
	SetAsset(ctx context.Context, key string, assetObj *base.UserAsset) (err error)
}

type UserAssetEventMsg

type UserAssetEventMsg struct {
	*station.BizEventAssetChange
}

Jump to

Keyboard shortcuts

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