storeutil

package
v0.0.0-...-80b22ab Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package storeutil contains a ListenerRegistry type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocks

type Blocks struct {
	Blocks                [config.ListSize]*dbtypes.StoreBlock
	Count                 int
	CurrentBlock          *api.Block
	CurrentBlockHeight    int64
	CurrentTxs            [config.ListSize]*dbtypes.Transaction
	TransactionPagination PageStore
	Pagination            PageStore
}

Blocks stores all data abotu blockchain blocks

type DecodedTransaction

type DecodedTransaction struct {
	EnvelopeHeight int64
	RawTxContents  []byte
	RawTx          models.Tx
	Time           time.Time
	ProcessID      string
	EntityID       string
	Nullifier      string
}

DecodedTransaction stores human-readable decoded transaction data

type Entities

type Entities struct {
	Count             int
	CurrentEntity     Entity
	CurrentEntityID   string
	EntityIDs         [config.ListSize]string
	Pagination        PageStore
	ProcessPagination PageStore
	ProcessHeights    map[string]int64
}

Entities stores the current entities information

type Entity

type Entity struct {
	ProcessCount int
	Processes    [config.ListSize]*dbtypes.Process
}

Entity holds info about one vochain entity

type Envelopes

type Envelopes struct {
	Count                 int
	CurrentEnvelope       *dbtypes.Envelope
	CurrentEnvelopeHeight int64
	Envelopes             [config.ListSize]*dbtypes.Envelope
	Pagination            PageStore
}

Envelopes stores the current envelopes information

type ListenerRegistry

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

ListenerRegistry is a listener registry. The zero value is unfit for use; use NewListenerRegistry to create an instance.

func NewListenerRegistry

func NewListenerRegistry() *ListenerRegistry

NewListenerRegistry creates a listener registry.

func (*ListenerRegistry) Add

func (r *ListenerRegistry) Add(key interface{}, listener func())

Add adds listener with key to the registry. key may be nil, then an arbitrary unused key is assigned. It panics if a listener with same key is already present.

func (*ListenerRegistry) Fire

func (r *ListenerRegistry) Fire()

Fire invokes all listeners in the registry.

func (*ListenerRegistry) Has

func (r *ListenerRegistry) Has(key interface{}) bool

Has returns true if the listener registry has a listener with the given key

func (*ListenerRegistry) Remove

func (r *ListenerRegistry) Remove(key interface{})

Remove removes a listener with key from the registry.

type PageStore

type PageStore struct {
	CurrentPage   int
	DisableUpdate bool
	Index         int
	PagChannel    chan int
	Search        bool
	SearchChannel chan string
	Tab           string
}

PageStore stores information needed to display/update a pagination element

type Process

type Process struct {
	Envelopes     [config.ListSize]*dbtypes.Envelope
	EnvelopeCount int
	ProcessType   string
	Results       [][]uint32
	State         string
}

Process holds info about one vochain process, including votes and results

type Processes

type Processes struct {
	Count                   int
	ProcessResults          map[string]Process
	ProcessKeys             map[string]*api.Pkeys
	Processes               [config.ListSize]*dbtypes.Process
	Pagination              PageStore
	EnvelopePagination      PageStore
	EnvelopeHeights         map[string]int64
	CurrentProcessResults   Process
	CurrentProcess          *dbtypes.Process
	CurrentProcessEnvelopes [config.ListSize]*dbtypes.Envelope
}

Processes stores the current processes information

type Transactions

type Transactions struct {
	Count                     int
	CurrentTransactionHeight  int64
	CurrentTransaction        *dbtypes.Transaction
	CurrentDecodedTransaction *DecodedTransaction
	CurrentBlock              *dbtypes.StoreBlock
	Pagination                PageStore
	Transactions              [config.ListSize]*dbtypes.Transaction
}

Transactions stores all data about blockchain transactions

type Validators

type Validators struct {
	BlockHeights       map[string]int64
	Count              int
	CurrentBlockCount  int
	CurrentBlockList   [config.ListSize]*dbtypes.StoreBlock
	CurrentValidator   *dbtypes.Validator
	CurrentValidatorID string
	Pagination         PageStore
	BlockPagination    PageStore
	Validators         [config.ListSize]*dbtypes.Validator
}

Validators stores all data about blockchain validators

Jump to

Keyboard shortcuts

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