schema

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MPL-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const QueryTmp = `` /* 301-byte string literal not displayed */

Variables

View Source
var (
	ErrSpawnTxNotFound       = errors.New("err_spawn_tx_not_found")
	ErrInvalidProcessType    = errors.New("err_invalid_process_type")
	ErrInvalidAssignmentType = errors.New("err_invalid_assignment_type")
	ErrInvalidDownloadItems  = errors.New("err_invalid_download_items")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	RedisUrl string `json:"redisUrl" yaml:"redisUrl"`
	Keyfile  string `json:"keyfile" yaml:"keyfile"`
	OptType  string `json:"optType" yaml:"optType"`
}

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 GraphQLTag struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type GraphQLTransactions

type GraphQLTransactions struct {
	PageInfo GraphQLPageInfo `json:"pageInfo"`
	Edges    []GraphQLEdge   `json:"edges"`
}

type IDB

type IDB interface {
	AddPending(txid string) error
	MoveToUploading() (int64, error)
	EndUpload() error

	IsUploadedBatch(txids []string) (map[string]bool, error)
	GetUploading() ([]string, error)
	SetBundledIn(bundledInID string) error
	GetBundledIn() (string, error)
}

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)
}

Jump to

Keyboard shortcuts

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