outputs

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDBinFilename added in v0.0.19

func ComputeDBinFilename(startBlock, stopBlock uint64) string

func ComputeStartBlock

func ComputeStartBlock(startBlock uint64, saveBlockInterval uint64) uint64

Types

type CacheItem

type CacheItem struct {
	BlockNum  uint64                 `json:"block_num"`
	BlockID   string                 `json:"block_id"`
	Payload   []byte                 `json:"payload"`
	Timestamp *timestamppb.Timestamp `json:"timestamp"`
	Cursor    string                 `json:"cursor"`
}

type ModulesOutputCache

type ModulesOutputCache struct {
	OutputCaches      map[string]*OutputCache
	SaveBlockInterval uint64
}

func NewModuleOutputCache

func NewModuleOutputCache(saveBlockInterval uint64) *ModulesOutputCache

func (*ModulesOutputCache) Flush added in v0.0.14

func (c *ModulesOutputCache) Flush(ctx context.Context) error

func (*ModulesOutputCache) RegisterModule

func (c *ModulesOutputCache) RegisterModule(module *pbsubstreams.Module, hash string, baseCacheStore dstore.Store) (*OutputCache, error)

func (*ModulesOutputCache) Update

func (c *ModulesOutputCache) Update(ctx context.Context, blockRef bstream.BlockRef) error

type OutputCache

type OutputCache struct {
	sync.RWMutex

	ModuleName        string
	CurrentBlockRange *block.Range

	Store dstore.Store
	// contains filtered or unexported fields
}

func NewOutputCache

func NewOutputCache(moduleName string, store dstore.Store, saveBlockInterval uint64) *OutputCache

func (*OutputCache) Delete added in v0.0.20

func (c *OutputCache) Delete(blockID string)

func (*OutputCache) Get

func (c *OutputCache) Get(clock *pbsubstreams.Clock) ([]byte, bool)

func (*OutputCache) GetAtBlock added in v0.0.19

func (c *OutputCache) GetAtBlock(blockNumber uint64) ([]byte, bool)

func (*OutputCache) IsOutOfRange

func (c *OutputCache) IsOutOfRange(ref bstream.BlockRef) bool

func (*OutputCache) ListCacheRanges added in v0.0.14

func (c *OutputCache) ListCacheRanges(ctx context.Context) (block.Ranges, error)

func (*OutputCache) ListContinuousCacheRanges added in v0.0.14

func (c *OutputCache) ListContinuousCacheRanges(ctx context.Context, from uint64) (block.Ranges, error)

func (*OutputCache) Load

func (c *OutputCache) Load(ctx context.Context, blockRange *block.Range) error

func (*OutputCache) LoadAtBlock added in v0.0.14

func (c *OutputCache) LoadAtBlock(ctx context.Context, atBlock uint64) (found bool, err error)

func (*OutputCache) Set

func (c *OutputCache) Set(clock *pbsubstreams.Clock, cursor string, data []byte) error

func (*OutputCache) SortedCacheItems

func (c *OutputCache) SortedCacheItems() (out []*CacheItem)

func (*OutputCache) String

func (c *OutputCache) String() string

Jump to

Keyboard shortcuts

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