outputs

package
v0.0.7-beta Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeStartBlock

func ComputeStartBlock(startBlock uint64, saveBlockInterval uint64) uint64

Types

type CacheItem

type CacheItem struct {
	BlockNum uint64 `json:"block_num"`
	BlockID  string
	Payload  []byte `json:"payload"`
}

type ModulesOutputCache

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

func NewModuleOutputCache

func NewModuleOutputCache(saveBlockInterval uint64) *ModulesOutputCache

func (*ModulesOutputCache) RegisterModule

func (c *ModulesOutputCache) RegisterModule(ctx context.Context, module *pbsubstreams.Module, hash string, baseCacheStore dstore.Store, requestedStartBlock uint64) (*OutputCache, error)

func (*ModulesOutputCache) Save

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

func (*ModulesOutputCache) Update

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

type OutputCache

type OutputCache struct {
	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) Get

func (c *OutputCache) Get(block *bstream.Block) ([]byte, bool, error)

func (*OutputCache) IsOutOfRange

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

func (*OutputCache) Load

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

func (*OutputCache) Set

func (c *OutputCache) Set(block *bstream.Block, data []byte) error

func (*OutputCache) SortedCacheItems

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

func (*OutputCache) String

func (o *OutputCache) String() string

Jump to

Keyboard shortcuts

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