Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPaymentExpiredRange = int64(3600) // 1 hour DefaultExpectedRange = 50 // block height range )
View Source
const ( WaitOnChain = "waiting" PendingOnChain = "pending" SuccOnChain = "success" FailedOnChain = "failed" // order payment status UnPayment = "unpaid" SuccPayment = "paid" ExpiredPayment = "expired" // ReceiptEverTx Status UnSpent = "unspent" Spent = "spent" UnRefund = "unrefund" Refund = "refunded" RefundErr = "refundErr" MaxPerOnChainSize = 500 * 1024 * 1024 // 500 MB )
View Source
const ( TaskTypeBroadcast = "broadcast" // include tx and tx data TaskTypeBroadcastMeta = "broadcast_meta" // not include tx data TaskTypeSync = "sync" )
View Source
const (
AllowMaxItemSize = 100 * 1024 * 1024 // 100 MB
)
View Source
const (
ConstTx = `` /* 1866-byte string literal not displayed */
)
Variables ¶
View Source
var ( ErrNotExist = errors.New("not_exist_record") ErrNotFound = errors.New("not_found") ErrExist = errors.New("s3_bucket_exist") ErrExistTx = errors.New("tx_exist") ErrTaskClosed = errors.New("task_closed") ErrFetchData = errors.New("fetch_tx_data_from_peers") ErrDataTooBig = errors.New("tx_data_too_big") ErrNullData = errors.New("null_data") )
View Source
var ( // bucket ChunkBucket = "chunk-bucket" // key: chunkStartOffset, val: chunk TxDataEndOffSetBucket = "tx-data-end-offset-bucket" // key: dataRoot+dataSize; val: txDataEndOffSet TxMetaBucket = "tx-meta-bucket" // key: txId, val: arTx; not include data ConstantsBucket = "constants-bucket" // tasks TaskIdPendingPoolBucket = "task-pending-pool-bucket" // key: taskId(taskType+"-"+arId), val: "0x01" TaskBucket = "task-bucket" // key: taskId(taskType+"-"+arId), val: task // bundle bucketName BundleItemBinary = "bundle-item-binary" BundleItemMeta = "bundle-item-meta" // parse arTx data to bundle items BundleWaitParseArIdBucket = "bundle-wait-parse-arId-bucket" // key: arId, val: "0x01" BundleArIdToItemIdsBucket = "bundle-arId-to-itemIds-bucket" // key: arId, val: json.marshal(itemIds) )
Functions ¶
This section is empty.
Types ¶
type Order ¶
type Order struct { gorm.Model ItemId string // bundleItem id Signer string `gorm:"index:idx1"` // item signer SignType int Size int64 Currency string // payment token symbol Decimals int Fee string PaymentExpiredTime int64 // uint s ExpectedBlock int64 PaymentStatus string // "unpaid", "paid", "expired" PaymentId string // everHash OnChainStatus string // "waiting","pending","success","failed" }
type ReceiptEverTx ¶
type ResBundler ¶
type ResBundler struct {
Bundler string `json:"bundler"`
}
type RespOrder ¶
type RespOrder struct { ItemId string `json:"itemId"` // bundleItem id Bundler string `json:"bundler"` // fee receiver address Currency string `json:"currency"` // payment token symbol Decimals int `json:"decimals"` Fee string `json:"fee"` PaymentExpiredTime int64 `json:"paymentExpiredTime"` ExpectedBlock int64 `json:"expectedBlock"` }
Click to show internal directories.
Click to hide internal directories.