Documentation
¶
Index ¶
Constants ¶
View Source
const QueryTmp = `` /* 301-byte string literal not displayed */
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DownloadResult ¶
type DownloadResult struct {
Nonce int64
Assignment *goarSchema.BundleItem
Message *goarSchema.BundleItem
}
type GraphQLEdge ¶
type GraphQLEdge struct {
Cursor string `json:"cursor"`
Node GraphQLNode `json:"node"`
}
type GraphQLNode ¶
type GraphQLNode struct {
ID string `json:"id"`
Tags []GraphQLTag `json:"tags"`
}
type GraphQLPageInfo ¶
type GraphQLPageInfo struct {
HasNextPage bool `json:"hasNextPage"`
}
type GraphQLResp ¶
type GraphQLResp struct {
Transactions GraphQLTransactions `json:"transactions"`
}
GraphQL response structs
type GraphQLTag ¶
type GraphQLTransactions ¶
type GraphQLTransactions struct {
PageInfo GraphQLPageInfo `json:"pageInfo"`
Edges []GraphQLEdge `json:"edges"`
}
type INode ¶
type INode interface {
// DB
GetMessage(msgid string) (msg *goarSchema.BundleItem, err error)
GetMessageByNonce(pid string, nonce int64) (msg *goarSchema.BundleItem, err error)
GetAssignByMessage(msgid string) (assign *goarSchema.BundleItem, err error)
GetAssignByNonce(pid string, nonce int64) (assign *goarSchema.BundleItem, err error)
}
type IOperator ¶
type IOperator interface {
// Upload a transaction in BundleItem form; a BundleItem may nest multiple BundleItems.
// The outermost BundleItem is submitted to the network as the atomic Transaction.
// The outermost BundleItem's txID is used as parentTxID when downloading.
Upload(items []goarSchema.BundleItem) (txid string, err error)
// Download a transaction
// return BundleItem format
Download(itemID string) (*goarSchema.BundleItem, error)
// Download multiple transactions
Downloads(itemIDs []string) ([]*goarSchema.BundleItem, error)
// Execute a GraphQL query.
GraphQL(query string) ([]byte, error)
// Check if a transaction upload success
CheckTransaction(txid string) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.