game

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HANDLEDURATION      = 10 * time.Minute
	TXTIMEOUTDURATION   = 20 * time.Minute
	LOCKTIMEOUTDURATION = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CbManager

type CbManager struct {
	TxTracker
}
var (
	CbMgr *CbManager
)

func NewCbManager

func NewCbManager(tracker TxTracker) *CbManager

func (*CbManager) Run

func (cm *CbManager) Run()

func (*CbManager) Update

func (cm *CbManager) Update(event interface{})

type NftManager

type NftManager struct {
	NftOwnerTracker
}

func NewNftManager

func NewNftManager(tracker NftOwnerTracker) *NftManager

func (*NftManager) Update

func (nm *NftManager) Update(event interface{})

type NftOwnerTracker

type NftOwnerTracker interface {
	QueryNftList(ownerAddr string, contractAddr string) ([]model.NftOwner, error)
	AddNftOwner(no model.NftOwner) error
	UpdateNftOwner(ownerAddr string, contractAddr string, tokenId int64, updateTime int64) error
	QueryNftOwner(tokenId int64, contractAddr string) ([]model.NftOwner, error)
}

type NftOwnerUpdateEvent

type NftOwnerUpdateEvent struct {
	OwnerAddr    string
	ContractAddr string
	TokenId      int64
	UpdateTime   int64
}

type NotifyEvent

type NotifyEvent struct {
	TxHash  string
	Status  int
	PayTime int64
}

type TxTracker

type TxTracker interface {
	SaveTxCb(tx model.SpikeTx) error
	RecordTxHash(uuidList []string, txHash string, txStatus int) error
	QueryGameCb(txHash string, notifyStatus int) ([]model.SpikeTx, error)
	UpdateTxStatus(txHash string, txStatus int, payTime int64) error
	UpdateTxNotifyStatus(orderId string, notifyStatus int) error
	QueryNotNotifyTx(notNotifyStatus int) ([]model.SpikeTx, error)
}

Jump to

Keyboard shortcuts

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