schema

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MPL-2.0 Imports: 3 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")
	ErrInvalidMessageType    = errors.New("err_invalid_message_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"`
	NodeRedisUrl string `json:"nodeRedisUrl" yaml:"nodeRedisUrl"`
	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 IDBChainkit added in v0.3.2

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

	IsUploadedBatch(txids []string) (map[string]bool, error)
	IsUploaded(txid string) (bool, error)

	GetUploading() ([]string, error)
	SetBundledIn(bundledInID string) error
	GetBundledIn() (string, error)

	Cache(txid string, item goarSchema.BundleItem) error
	GetCache(txid string) (*goarSchema.BundleItem, error)
}

type IDBTool added in v0.3.2

type IDBTool interface {
	// DB
	GetMessage(msgid string) (msg *goarSchema.BundleItem, err error)
	GetAssignByNonce(pid string, nonce int64) (assign *goarSchema.BundleItem, err error)
	GetResult(msgid string) (result *vmmSchema.VmmResult, 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