indexer

package
v0.0.0-...-efbdb50 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetricSet = dmetrics.NewSet()

Functions

func ModeNames

func ModeNames() []string

ModeNames returns a list of possible string values of Mode.

Types

type Blk

type Blk struct {
	Id  string
	Num uint64
}

type Indexer

type Indexer struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func New

func New(
	rpcClient *rpc.Client,
	streamFactory blocks.Firehose,
	subgraph *subgraph.Definition,
	opts ...Option,
) *Indexer

func NewBatch

func NewBatch(
	step int,
	startBlock uint64,
	stopBlock uint64,
	rpcClient *rpc.Client,
	streamFactory blocks.Firehose,
	subgraph *subgraph.Definition,
	opts ...Option,
) *Indexer

func (*Indexer) Start

func (i *Indexer) Start(makeStore StoreFactory) error

type Mode

type Mode uint

ENUM(

Batch
Live

)

const (
	// ModeBatch is a Mode of type Batch.
	ModeBatch Mode = iota
	// ModeLive is a Mode of type Live.
	ModeLive
)

func ParseMode

func ParseMode(name string) (Mode, error)

ParseMode attempts to convert a string to a Mode

func (Mode) MarshalText

func (x Mode) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (Mode) String

func (x Mode) String() string

String implements the Stringer interface.

func (*Mode) UnmarshalText

func (x *Mode) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type Option

type Option interface {
	// contains filtered or unexported methods
}

func StartBlock

func StartBlock(startBlock int64) Option

func StopBlock

func StopBlock(stopBlock uint64) Option

func UseTransactionalFlush

func UseTransactionalFlush() Option

func WithNonArchiveNode

func WithNonArchiveNode() Option

func WithPOI

func WithPOI(networkName string) Option

func WithRPCCache

func WithRPCCache(cache *RPCCache) Option

func WithReversible

func WithReversible() Option

type RPCCache

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

func NewCache

func NewCache(readStore, writeStore dstore.Store, startBlockNum, endBlockNum uint64) *RPCCache

func (*RPCCache) Get

func (c *RPCCache) Get(k RPCCacheKey, out interface{}) (found bool)

func (*RPCCache) GetRaw

func (c *RPCCache) GetRaw(k RPCCacheKey) (v []byte, found bool)

func (*RPCCache) Key

func (_ *RPCCache) Key(prefix string, items ...interface{}) RPCCacheKey

func (*RPCCache) Load

func (c *RPCCache) Load(ctx context.Context)

func (*RPCCache) Save

func (c *RPCCache) Save(ctx context.Context)

func (*RPCCache) Set

func (c *RPCCache) Set(k RPCCacheKey, v interface{})

type RPCCacheKey

type RPCCacheKey string

type SyncStatus

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

func NewSyncStatus

func NewSyncStatus() *SyncStatus

func (*SyncStatus) Update

func (s *SyncStatus) Update(blockNum uint64)

type TestBlocksClient

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

func (TestBlocksClient) CloseSend

func (t TestBlocksClient) CloseSend() error

func (TestBlocksClient) Context

func (t TestBlocksClient) Context() context.Context

func (TestBlocksClient) Header

func (t TestBlocksClient) Header() (metadata.MD, error)

func (*TestBlocksClient) Recv

func (t *TestBlocksClient) Recv() (*pbfirehose.Response, error)

func (pbfirehose.Stream_BlocksClient).Recv() (*pbfirehose.Response, error)

func (TestBlocksClient) RecvMsg

func (t TestBlocksClient) RecvMsg(m interface{}) error

func (TestBlocksClient) SendMsg

func (t TestBlocksClient) SendMsg(m interface{}) error

func (TestBlocksClient) Trailer

func (t TestBlocksClient) Trailer() metadata.MD

type TestIntrinsics

type TestIntrinsics struct {
}

func (TestIntrinsics) Block

func (t TestIntrinsics) Block() subgraph.BlockRef

func (TestIntrinsics) Load

func (t TestIntrinsics) Load(entity entity.Interface) error

func (TestIntrinsics) Remove

func (t TestIntrinsics) Remove(entity entity.Interface) error

func (TestIntrinsics) Save

func (t TestIntrinsics) Save(entity entity.Interface) error

func (TestIntrinsics) SqlSelect

func (t TestIntrinsics) SqlSelect(dest interface{}, query string, args ...interface{}) error

func (TestIntrinsics) StepAbove

func (t TestIntrinsics) StepAbove(step int) bool

func (TestIntrinsics) StepBelow

func (t TestIntrinsics) StepBelow(step int) bool

Jump to

Keyboard shortcuts

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