indexing

package
v0.5.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockStateIndex

type BlockStateIndex struct {
	ProducedSynthTxns []*BlockStateSynthTxnEntry `json:"producedSynthTxns,omitempty" form:"producedSynthTxns" query:"producedSynthTxns" validate:"required"`
	// contains filtered or unexported fields
}

func (*BlockStateIndex) Equal

func (v *BlockStateIndex) Equal(u *BlockStateIndex) bool

func (*BlockStateIndex) IsValid

func (v *BlockStateIndex) IsValid() error

func (*BlockStateIndex) MarshalBinary

func (v *BlockStateIndex) MarshalBinary() ([]byte, error)

func (*BlockStateIndex) UnmarshalBinary

func (v *BlockStateIndex) UnmarshalBinary(data []byte) error

func (*BlockStateIndex) UnmarshalBinaryFrom

func (v *BlockStateIndex) UnmarshalBinaryFrom(rd io.Reader) error

type BlockStateIndexer

type BlockStateIndexer struct {
	// contains filtered or unexported fields
}

BlockStateIndexer tracks transient state for a block.

func BlockState

func BlockState(batch *database.Batch, ledger *url.URL) *BlockStateIndexer

BlockState returns a block state indexer.

func (*BlockStateIndexer) Clear

func (x *BlockStateIndexer) Clear() error

Clear resets the block state.

func (*BlockStateIndexer) DidProduceSynthTxn

func (x *BlockStateIndexer) DidProduceSynthTxn(entry *BlockStateSynthTxnEntry) error

DidProduceSynthTxn records a produced synthetic transaction.

func (*BlockStateIndexer) Get

Get loads the block state.

type BlockStateSynthTxnEntry

type BlockStateSynthTxnEntry struct {
	Transaction []byte `json:"transaction,omitempty" form:"transaction" query:"transaction" validate:"required"`
	ChainEntry  uint64 `json:"chainEntry,omitempty" form:"chainEntry" query:"chainEntry" validate:"required"`
	// contains filtered or unexported fields
}

func (*BlockStateSynthTxnEntry) Equal

func (*BlockStateSynthTxnEntry) IsValid

func (v *BlockStateSynthTxnEntry) IsValid() error

func (*BlockStateSynthTxnEntry) MarshalBinary

func (v *BlockStateSynthTxnEntry) MarshalBinary() ([]byte, error)

func (*BlockStateSynthTxnEntry) MarshalJSON

func (v *BlockStateSynthTxnEntry) MarshalJSON() ([]byte, error)

func (*BlockStateSynthTxnEntry) UnmarshalBinary

func (v *BlockStateSynthTxnEntry) UnmarshalBinary(data []byte) error

func (*BlockStateSynthTxnEntry) UnmarshalBinaryFrom

func (v *BlockStateSynthTxnEntry) UnmarshalBinaryFrom(rd io.Reader) error

func (*BlockStateSynthTxnEntry) UnmarshalJSON

func (v *BlockStateSynthTxnEntry) UnmarshalJSON(data []byte) error

type DirectoryAnchorIndexer

type DirectoryAnchorIndexer struct {
	// contains filtered or unexported fields
}

DirectoryAnchorIndexer indexes directory anchors.

func DirectoryAnchor

func DirectoryAnchor(batch *database.Batch, ledger *url.URL) *DirectoryAnchorIndexer

DirectoryAnchor returns a directory anchor indexer.

func (*DirectoryAnchorIndexer) Add

Add indexes a directory anchor.

func (*DirectoryAnchorIndexer) AnchorForLocalBlock

func (x *DirectoryAnchorIndexer) AnchorForLocalBlock(block uint64, major bool) (*protocol.SyntheticAnchor, error)

AnchorForLocalBlock retrieves the directory anchor that anchors the given local block.

type PendingTransactionsIndex

type PendingTransactionsIndex struct {
	Transactions [][32]byte `json:"transactions,omitempty" form:"transactions" query:"transactions" validate:"required"`
	// contains filtered or unexported fields
}

func (*PendingTransactionsIndex) Equal

func (*PendingTransactionsIndex) IsValid

func (v *PendingTransactionsIndex) IsValid() error

func (*PendingTransactionsIndex) MarshalBinary

func (v *PendingTransactionsIndex) MarshalBinary() ([]byte, error)

func (*PendingTransactionsIndex) MarshalJSON

func (v *PendingTransactionsIndex) MarshalJSON() ([]byte, error)

func (*PendingTransactionsIndex) UnmarshalBinary

func (v *PendingTransactionsIndex) UnmarshalBinary(data []byte) error

func (*PendingTransactionsIndex) UnmarshalBinaryFrom

func (v *PendingTransactionsIndex) UnmarshalBinaryFrom(rd io.Reader) error

func (*PendingTransactionsIndex) UnmarshalJSON

func (v *PendingTransactionsIndex) UnmarshalJSON(data []byte) error

type PendingTransactionsIndexer

type PendingTransactionsIndexer struct {
	// contains filtered or unexported fields
}

PendingTransactionsIndexer indexes pending transactions of an account.

func PendingTransactions

func PendingTransactions(batch *database.Batch, account *url.URL) *PendingTransactionsIndexer

PendingTransactions returns a pending transactions indexer.

func (*PendingTransactionsIndexer) Add

func (x *PendingTransactionsIndexer) Add(txid [32]byte) error

Add adds a transaction to the list of pending transactions, if it is not already on the list.

func (*PendingTransactionsIndexer) Get

func (x *PendingTransactionsIndexer) Get() ([][32]byte, error)

Get loads the list of pending transactions.

func (*PendingTransactionsIndexer) Remove

func (x *PendingTransactionsIndexer) Remove(txid [32]byte) error

Remove removes a transaction from the list of pending transactions, if it is on the list.

type TransactionChainEntry

type TransactionChainEntry struct {
	Account     *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Chain       string   `json:"chain,omitempty" form:"chain" query:"chain" validate:"required"`
	Block       uint64   `json:"block,omitempty" form:"block" query:"block" validate:"required"`
	ChainEntry  uint64   `json:"chainEntry,omitempty" form:"chainEntry" query:"chainEntry" validate:"required"`
	ChainAnchor uint64   `json:"chainAnchor,omitempty" form:"chainAnchor" query:"chainAnchor" validate:"required"`
	RootEntry   uint64   `json:"rootEntry,omitempty" form:"rootEntry" query:"rootEntry" validate:"required"`
	RootAnchor  uint64   `json:"rootAnchor,omitempty" form:"rootAnchor" query:"rootAnchor" validate:"required"`
	// contains filtered or unexported fields
}

func (*TransactionChainEntry) Equal

func (*TransactionChainEntry) IsValid

func (v *TransactionChainEntry) IsValid() error

func (*TransactionChainEntry) MarshalBinary

func (v *TransactionChainEntry) MarshalBinary() ([]byte, error)

func (*TransactionChainEntry) UnmarshalBinary

func (v *TransactionChainEntry) UnmarshalBinary(data []byte) error

func (*TransactionChainEntry) UnmarshalBinaryFrom

func (v *TransactionChainEntry) UnmarshalBinaryFrom(rd io.Reader) error

type TransactionChainIndex

type TransactionChainIndex struct {
	Entries []*TransactionChainEntry `json:"entries,omitempty" form:"entries" query:"entries" validate:"required"`
	// contains filtered or unexported fields
}

func (*TransactionChainIndex) Equal

func (*TransactionChainIndex) IsValid

func (v *TransactionChainIndex) IsValid() error

func (*TransactionChainIndex) MarshalBinary

func (v *TransactionChainIndex) MarshalBinary() ([]byte, error)

func (*TransactionChainIndex) UnmarshalBinary

func (v *TransactionChainIndex) UnmarshalBinary(data []byte) error

func (*TransactionChainIndex) UnmarshalBinaryFrom

func (v *TransactionChainIndex) UnmarshalBinaryFrom(rd io.Reader) error

type TransactionChainIndexer

type TransactionChainIndexer struct {
	// contains filtered or unexported fields
}

TransactionChainIndexer indexes account chains against a transaction.

func TransactionChain

func TransactionChain(batch *database.Batch, txid []byte) *TransactionChainIndexer

TransactionChain returns a transaction chain indexer.

func (*TransactionChainIndexer) Add

Add adds a new entry to the index.

func (*TransactionChainIndexer) Get

Get loads and unmarshals the index. Get returns an empty index if it has not been defined.

Jump to

Keyboard shortcuts

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