Documentation ¶
Index ¶
- Constants
- Variables
- type ArFee
- type AutoApiKey
- type DailyStatistic
- type Fee
- type IndexPath
- type KafkaBundleItem
- type KafkaOnChainInfo
- type KafkaOrderInfo
- type Manifest
- type ManifestData
- type OnChainTx
- type Order
- type OrderStatistic
- type PaymentMeta
- type PeerCount
- type Range
- type ReceiptEverTx
- type ResBundler
- type Resource
- type RespApiKey
- type RespErr
- type RespFee
- type RespGetOrder
- type RespItemId
- type RespOrder
- type RespReceiptEverTx
- type Result
- type Task
- type TimeRange
- type TokBal
- type TokenPrice
Constants ¶
View Source
const ( AllowStreamMinItemSize = 5 * 1024 * 1024 // 5 MB AllowMaxRespDataSize = 50 * 1024 * 1024 // 50 MB SubmitMaxSize = 1024 * 1024 * 1024 // 1 GB )
View Source
const ( DefaultPaymentExpiredRange = int64(2592000) // 30 days 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 = 2 * 1024 * 1024 * 1024 // 2 GB TmpFileDir = "./tmpFile" )
View Source
const ( ManifestType = "application/x.arweave-manifest+json" ContentType = "Content-Type" ManiData = `` /* 652-byte string literal not displayed */ )
View Source
const ( TaskTypeBroadcast = "broadcast" // include tx and tx data TaskTypeBroadcastMeta = "broadcast_meta" // not include tx data TaskTypeSync = "sync" TaskTypeSyncManifest = "sync_manifest" // sync manifest )
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") ErrLocalNotExist = errors.New("not_exist_local") // need to get data from gateway ErrPageNotFound = errors.New("page_not_found") // e.g manifest data not contain index path ErrNotImplement = errors.New("method not implement") )
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) //statistic StatisticBucket = "order-statistic-bucket" )
Functions ¶
This section is empty.
Types ¶
type AutoApiKey ¶ added in v1.0.31
type AutoApiKey struct { ID uint `gorm:"primarykey" json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` ApiKey string `gorm:"index:apikey01,unique"` EncryptedKey string Address string `gorm:"index:apikey02,unique"` PubKey string TokenBalance datatypes.JSONMap // key: symbol,val: balance }
type DailyStatistic ¶ added in v1.1.3
type KafkaBundleItem ¶ added in v1.1.5
type KafkaBundleItem struct { SignatureType int `json:"signatureType"` Signature string `json:"signature"` Owner string `json:"owner"` // utils.Base64Encode(pubkey) Target string `json:"target"` // optional, if exist must length 32, and is base64 str Anchor string `json:"anchor"` // optional, if exist must length 32, and is base64 str Tags []types.Tag `json:"tags"` Id string `json:"id"` Size int64 `json:"size"` Address string `json:"address"` Type string `json:"type"` // data type }
type KafkaOnChainInfo ¶ added in v1.1.5
type KafkaOrderInfo ¶ added in v1.1.5
type ManifestData ¶ added in v1.0.8
type Order ¶
type Order struct { ID uint `gorm:"primarykey" json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` ItemId string `gorm:"index:idx0" json:"itemId"` // bundleItem id Signer string `gorm:"index:idx1" json:"signer"` // item signer SignType int `json:"signType"` Size int64 `json:"size"` Currency string `json:"currency"` // payment token symbol Decimals int `json:"decimals"` Fee string `json:"fee"` PaymentExpiredTime int64 `json:"paymentExpiredTime"` // uint s ExpectedBlock int64 `json:"expectedBlock"` PaymentStatus string `gorm:"index:idx0" json:"paymentStatus"` // "unpaid", "paid", "expired" PaymentId string `json:"paymentId"` // everHash OnChainStatus string `gorm:"index:idx5" json:"onChainStatus"` // "waiting","pending","success","failed" ApiKey string `gorm:"index:idx2" json:"-"` Sort bool `json:"sort"` // upload items to arweave by sequence Kafka bool `gorm:"index:idx0" json:"kafka"` // send to kafka }
type OrderStatistic ¶ added in v1.1.3
type PaymentMeta ¶ added in v1.2.3
type ReceiptEverTx ¶
type ResBundler ¶
type ResBundler struct {
Bundler string `json:"bundler"`
}
type RespApiKey ¶ added in v1.0.31
type RespGetOrder ¶ added in v1.1.8
type RespItemId ¶ added in v1.0.7
type RespOrder ¶
type RespOrder struct { ItemId string `json:"itemId"` // bundleItem id Size int64 `json:"size"` 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"` }
type RespReceiptEverTx ¶ added in v1.1.2
Click to show internal directories.
Click to hide internal directories.