Documentation ¶
Index ¶
- Variables
- func FullStateFileName(r *block.Range) string
- func PartialFileName(r *block.Range) string
- type Appender
- type ConditionalKeySetter
- type Config
- func (c *Config) ExistsFullKV(ctx context.Context, upTo uint64) (bool, error)
- func (c *Config) ExistsPartialKV(ctx context.Context, from, to uint64) (bool, error)
- func (c *Config) FileSize(ctx context.Context, fileInfo *FileInfo) (int64, error)
- func (c *Config) ListSnapshotFiles(ctx context.Context, below uint64) (files []*FileInfo, err error)
- func (c *Config) ModuleHash() string
- func (c *Config) ModuleInitialBlock() uint64
- func (c *Config) Name() string
- func (c *Config) NewFullKV(logger *zap.Logger) *FullKV
- func (c *Config) NewPartialKV(initialBlock uint64, logger *zap.Logger) *PartialKV
- func (c *Config) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
- func (c *Config) ValueType() string
- type ConfigMap
- type Deleter
- type DeltaAccessor
- type FileInfo
- func CompleteFile(in string, params ...FileInfoParam) *FileInfo
- func NewCompleteFileInfo(moduleName string, moduleInitialBlock uint64, exclusiveEndBlock uint64) *FileInfo
- func NewPartialFileInfo(moduleName string, start uint64, exclusiveEndBlock uint64) *FileInfo
- func PartialFile(in string, params ...FileInfoParam) *FileInfo
- type FileInfoParam
- type FileInfos
- type FullKV
- func (b FullKV) Append(ord uint64, key string, value []byte)
- func (b FullKV) ApplyDelta(delta *pbsubstreams.StoreDelta)
- func (b FullKV) ApplyDeltasReverse(deltas []*pbsubstreams.StoreDelta)
- func (b FullKV) ApplyOps(in []byte) error
- func (b FullKV) DeletePrefix(ord uint64, prefix string)
- func (s *FullKV) DerivePartialStore(initialBlock uint64) *PartialKV
- func (b FullKV) Flush() error
- func (b FullKV) GetAt(ord uint64, key string) (out []byte, found bool)
- func (b FullKV) GetDeltas() []*pbsubstreams.StoreDelta
- func (b FullKV) GetFirst(key string) ([]byte, bool)
- func (b FullKV) GetLast(key string) ([]byte, bool)
- func (b FullKV) HasAt(ord uint64, key string) bool
- func (b FullKV) HasFirst(key string) bool
- func (b FullKV) HasLast(key string) bool
- func (b FullKV) InitialBlock() uint64
- func (b FullKV) Iter(f func(key string, value []byte) error) error
- func (b FullKV) Length() uint64
- func (s *FullKV) Load(ctx context.Context, file *FileInfo) error
- func (b FullKV) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (s *FullKV) Marshaller() marshaller.Marshaller
- func (b FullKV) Merge(kvPartialStore *PartialKV) error
- func (b FullKV) Name() string
- func (b FullKV) ReadOps() []byte
- func (b FullKV) Reset()
- func (s *FullKV) Save(endBoundaryBlock uint64) (*FileInfo, *fileWriter, error)
- func (b FullKV) Set(ord uint64, key string, value string)
- func (b FullKV) SetBytes(ord uint64, key string, value []byte)
- func (b FullKV) SetBytesIfNotExists(ord uint64, key string, value []byte)
- func (b FullKV) SetDeltas(deltas []*pbsubstreams.StoreDelta)
- func (b FullKV) SetIfNotExists(ord uint64, key string, value string)
- func (b FullKV) SetMaxBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b FullKV) SetMaxBigInt(ord uint64, key string, value *big.Int)
- func (b FullKV) SetMaxFloat64(ord uint64, key string, value float64)
- func (b FullKV) SetMaxInt64(ord uint64, key string, value int64)
- func (b FullKV) SetMinBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b FullKV) SetMinBigInt(ord uint64, key string, value *big.Int)
- func (b FullKV) SetMinFloat64(ord uint64, key string, value float64)
- func (b FullKV) SetMinInt64(ord uint64, key string, value int64)
- func (b FullKV) SetSumBigDecimal(ord uint64, key string, value []byte)
- func (b FullKV) SetSumBigInt(ord uint64, key string, value []byte)
- func (b FullKV) SetSumFloat64(ord uint64, key string, value []byte)
- func (b FullKV) SetSumInt64(ord uint64, key string, value []byte)
- func (b FullKV) SizeBytes() uint64
- func (s *FullKV) String() string
- func (b FullKV) SumBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b FullKV) SumBigInt(ord uint64, key string, value *big.Int)
- func (b FullKV) SumFloat64(ord uint64, key string, value float64)
- func (b FullKV) SumInt64(ord uint64, key string, value int64)
- func (b FullKV) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
- func (b FullKV) ValueType() string
- type Getter
- type Iterable
- type Loadable
- type Map
- type MaxBigDecimalSetter
- type MaxBigIntSetter
- type MaxFloat64Setter
- type MaxInt64Setter
- type Mergeable
- type MinBigDecimalSetter
- type MinBigIntSetter
- type MinFloat64Setter
- type MinInt64Setter
- type Named
- type PartialKV
- func (b PartialKV) Append(ord uint64, key string, value []byte)
- func (p *PartialKV) ApplyDelta(delta *pbsubstreams.StoreDelta)
- func (p *PartialKV) ApplyDeltasReverse(deltas []*pbsubstreams.StoreDelta)
- func (b PartialKV) ApplyOps(in []byte) error
- func (p *PartialKV) DeletePrefix(ord uint64, prefix string)
- func (p *PartialKV) DeleteStore(ctx context.Context, file *FileInfo) (err error)
- func (b PartialKV) Flush() error
- func (b PartialKV) GetAt(ord uint64, key string) (out []byte, found bool)
- func (b PartialKV) GetDeltas() []*pbsubstreams.StoreDelta
- func (b PartialKV) GetFirst(key string) ([]byte, bool)
- func (b PartialKV) GetLast(key string) ([]byte, bool)
- func (b PartialKV) HasAt(ord uint64, key string) bool
- func (b PartialKV) HasFirst(key string) bool
- func (b PartialKV) HasLast(key string) bool
- func (p *PartialKV) InitialBlock() uint64
- func (b PartialKV) Iter(f func(key string, value []byte) error) error
- func (b PartialKV) Length() uint64
- func (p *PartialKV) Load(ctx context.Context, file *FileInfo) error
- func (b PartialKV) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (b PartialKV) Merge(kvPartialStore *PartialKV) error
- func (b PartialKV) Name() string
- func (b PartialKV) ReadOps() []byte
- func (b PartialKV) Reset()
- func (p *PartialKV) Roll(lastBlock uint64)
- func (p *PartialKV) Save(endBoundaryBlock uint64) (*FileInfo, *fileWriter, error)
- func (b PartialKV) Set(ord uint64, key string, value string)
- func (b PartialKV) SetBytes(ord uint64, key string, value []byte)
- func (b PartialKV) SetBytesIfNotExists(ord uint64, key string, value []byte)
- func (b PartialKV) SetDeltas(deltas []*pbsubstreams.StoreDelta)
- func (b PartialKV) SetIfNotExists(ord uint64, key string, value string)
- func (b PartialKV) SetMaxBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b PartialKV) SetMaxBigInt(ord uint64, key string, value *big.Int)
- func (b PartialKV) SetMaxFloat64(ord uint64, key string, value float64)
- func (b PartialKV) SetMaxInt64(ord uint64, key string, value int64)
- func (b PartialKV) SetMinBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b PartialKV) SetMinBigInt(ord uint64, key string, value *big.Int)
- func (b PartialKV) SetMinFloat64(ord uint64, key string, value float64)
- func (b PartialKV) SetMinInt64(ord uint64, key string, value int64)
- func (b PartialKV) SetSumBigDecimal(ord uint64, key string, value []byte)
- func (b PartialKV) SetSumBigInt(ord uint64, key string, value []byte)
- func (b PartialKV) SetSumFloat64(ord uint64, key string, value []byte)
- func (b PartialKV) SetSumInt64(ord uint64, key string, value []byte)
- func (b PartialKV) SizeBytes() uint64
- func (p *PartialKV) String() string
- func (b PartialKV) SumBigDecimal(ord uint64, key string, value decimal.Decimal)
- func (b PartialKV) SumBigInt(ord uint64, key string, value *big.Int)
- func (b PartialKV) SumFloat64(ord uint64, key string, value float64)
- func (b PartialKV) SumInt64(ord uint64, key string, value int64)
- func (b PartialKV) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
- func (b PartialKV) ValueType() string
- type PartialStore
- type Reader
- type Resettable
- type Savable
- type SetSumBigDecimalSetter
- type SetSumBigIntSetter
- type SetSumFloat64Setter
- type SetSumInt64Setter
- type Setter
- type Store
- type SumBigDecimalSetter
- type SumBigIntSetter
- type SumFloat64Setter
- type SumInt64Setter
- type UpdateKeySetter
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("store not found")
var StoreAboveMaxSizeRegexp = regexp.MustCompile("store .* became too big at [0-9]*, maximum size: [0-9]*")
Functions ¶
func FullStateFileName ¶ added in v1.1.3
func PartialFileName ¶ added in v1.1.3
Types ¶
type ConditionalKeySetter ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig( name string, moduleInitialBlock uint64, moduleHash string, updatePolicy pbsubstreams.Module_KindStore_UpdatePolicy, valueType string, store dstore.Store, ) (*Config, error)
func (*Config) ExistsFullKV ¶ added in v1.4.0
func (*Config) ExistsPartialKV ¶ added in v1.4.0
func (*Config) ListSnapshotFiles ¶
func (*Config) ModuleHash ¶
func (*Config) ModuleInitialBlock ¶
func (*Config) NewPartialKV ¶
func (*Config) UpdatePolicy ¶
func (c *Config) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
type ConfigMap ¶
func NewConfigMap ¶
func NewConfigMap(baseObjectStore dstore.Store, storeModules []*pbsubstreams.Module, moduleHashes *manifest.ModuleHashes) (out ConfigMap, err error)
type DeltaAccessor ¶
type DeltaAccessor interface { SetDeltas([]*pbsubstreams.StoreDelta) GetDeltas() []*pbsubstreams.StoreDelta ReadOps() []byte Flush() error ApplyDeltasReverse(deltas []*pbsubstreams.StoreDelta) ApplyDelta(delta *pbsubstreams.StoreDelta) ApplyOps(in []byte) error }
type FileInfo ¶
type FileInfo struct { ModuleName string Filename string Range *block.Range Partial bool WithTraceID bool }
func CompleteFile ¶ added in v1.1.3
func CompleteFile(in string, params ...FileInfoParam) *FileInfo
CompleteFile returns a FileInfo for the given range, infallibly, panics on errors, ideal for tests.
func NewCompleteFileInfo ¶ added in v1.1.3
func NewPartialFileInfo ¶ added in v1.1.3
func PartialFile ¶ added in v1.1.3
func PartialFile(in string, params ...FileInfoParam) *FileInfo
PartialFile returns a FileInfo for the given range, infallibly, panics on errors, ideal for tests.
type FileInfoParam ¶ added in v1.1.3
type FileInfoParam interface {
// contains filtered or unexported methods
}
type FileInfos ¶ added in v1.1.3
type FileInfos []*FileInfo
func CompleteFiles ¶ added in v1.1.3
func CompleteFiles(in string, params ...FileInfoParam) FileInfos
CompleteFiles returns a list of FileInfo for the given ranges, infallibly, panics on errors, ideal for tests.
func PartialFiles ¶ added in v1.1.3
func PartialFiles(in string, params ...FileInfoParam) FileInfos
PartialFiles returns a list of FileInfo for the given ranges, infallibly, panics on errors, ideal for tests.
type FullKV ¶
type FullKV struct {
// contains filtered or unexported fields
}
func (FullKV) ApplyDelta ¶
func (b FullKV) ApplyDelta(delta *pbsubstreams.StoreDelta)
func (FullKV) ApplyDeltasReverse ¶
func (b FullKV) ApplyDeltasReverse(deltas []*pbsubstreams.StoreDelta)
func (FullKV) DeletePrefix ¶
func (*FullKV) DerivePartialStore ¶
func (FullKV) GetDeltas ¶
func (b FullKV) GetDeltas() []*pbsubstreams.StoreDelta
func (FullKV) HasAt ¶ added in v1.0.0
HasAt returns true if the key exists for the state that includes the processing of `ord`.
func (FullKV) InitialBlock ¶
func (b FullKV) InitialBlock() uint64
func (FullKV) MarshalLogObject ¶
func (b FullKV) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (*FullKV) Marshaller ¶
func (s *FullKV) Marshaller() marshaller.Marshaller
func (FullKV) Merge ¶
Merge nextStore _into_ `s`, where nextStore is for the next contiguous segment's store output.
func (*FullKV) Save ¶
Save is to be called ONLY when we just passed the `nextExpectedBoundary` and processed nothing more after that boundary.
func (FullKV) SetBytesIfNotExists ¶
func (FullKV) SetDeltas ¶
func (b FullKV) SetDeltas(deltas []*pbsubstreams.StoreDelta)
func (FullKV) SetIfNotExists ¶
func (FullKV) SetMaxBigDecimal ¶
func (FullKV) SetMaxFloat64 ¶
func (FullKV) SetMaxInt64 ¶
func (FullKV) SetMinBigDecimal ¶
func (FullKV) SetMinFloat64 ¶
func (FullKV) SetMinInt64 ¶
func (FullKV) SetSumBigDecimal ¶ added in v1.7.0
func (FullKV) SetSumBigInt ¶ added in v1.7.0
func (FullKV) SetSumFloat64 ¶ added in v1.7.0
func (FullKV) SetSumInt64 ¶ added in v1.7.0
func (FullKV) SumBigDecimal ¶
func (FullKV) SumFloat64 ¶
func (FullKV) UpdatePolicy ¶
func (b FullKV) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
type Map ¶
func (Map) MarshalLogObject ¶
func (m Map) MarshalLogObject(enc zapcore.ObjectEncoder) error
type MaxBigDecimalSetter ¶
type MaxBigIntSetter ¶
type MaxFloat64Setter ¶
type MaxInt64Setter ¶
type Mergeable ¶
type Mergeable interface { ValueType() string UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy }
type MinBigDecimalSetter ¶
type MinBigIntSetter ¶
type MinFloat64Setter ¶
type MinInt64Setter ¶
type PartialKV ¶
type PartialKV struct { DeletedPrefixes []string // contains filtered or unexported fields }
func (*PartialKV) ApplyDelta ¶
func (p *PartialKV) ApplyDelta(delta *pbsubstreams.StoreDelta)
func (*PartialKV) ApplyDeltasReverse ¶
func (p *PartialKV) ApplyDeltasReverse(deltas []*pbsubstreams.StoreDelta)
func (*PartialKV) DeletePrefix ¶
func (*PartialKV) DeleteStore ¶
func (PartialKV) GetDeltas ¶
func (b PartialKV) GetDeltas() []*pbsubstreams.StoreDelta
func (PartialKV) HasAt ¶ added in v1.0.0
HasAt returns true if the key exists for the state that includes the processing of `ord`.
func (*PartialKV) InitialBlock ¶
func (PartialKV) MarshalLogObject ¶
func (b PartialKV) MarshalLogObject(enc zapcore.ObjectEncoder) error
func (PartialKV) Merge ¶
Merge nextStore _into_ `s`, where nextStore is for the next contiguous segment's store output.
func (PartialKV) SetBytesIfNotExists ¶
func (PartialKV) SetDeltas ¶
func (b PartialKV) SetDeltas(deltas []*pbsubstreams.StoreDelta)
func (PartialKV) SetIfNotExists ¶
func (PartialKV) SetMaxBigDecimal ¶
func (PartialKV) SetMaxBigInt ¶
func (PartialKV) SetMaxFloat64 ¶
func (PartialKV) SetMaxInt64 ¶
func (PartialKV) SetMinBigDecimal ¶
func (PartialKV) SetMinBigInt ¶
func (PartialKV) SetMinFloat64 ¶
func (PartialKV) SetMinInt64 ¶
func (PartialKV) SetSumBigDecimal ¶ added in v1.7.0
func (PartialKV) SetSumBigInt ¶ added in v1.7.0
func (PartialKV) SetSumFloat64 ¶ added in v1.7.0
func (PartialKV) SetSumInt64 ¶ added in v1.7.0
func (PartialKV) SumBigDecimal ¶
func (PartialKV) SumFloat64 ¶
func (PartialKV) UpdatePolicy ¶
func (b PartialKV) UpdatePolicy() pbsubstreams.Module_KindStore_UpdatePolicy
type PartialStore ¶
type PartialStore interface {
Roll(lastBlock uint64)
}
type Resettable ¶
type Resettable interface {
Reset()
}
type SetSumBigDecimalSetter ¶ added in v1.7.0
type SetSumBigIntSetter ¶ added in v1.7.0
type SetSumFloat64Setter ¶ added in v1.7.0
type SetSumInt64Setter ¶ added in v1.7.0
type Store ¶
type Store interface { Name() string InitialBlock() uint64 SizeBytes() uint64 Flush() error Loadable Savable Iterable DeltaAccessor Resettable Mergeable Named // intrinsics Reader UpdateKeySetter ConditionalKeySetter Appender Deleter MaxBigIntSetter MaxInt64Setter MaxFloat64Setter MaxBigDecimalSetter MinBigIntSetter MinInt64Setter MinFloat64Setter MinBigDecimalSetter SumBigIntSetter SumInt64Setter SumFloat64Setter SumBigDecimalSetter SetSumInt64Setter SetSumFloat64Setter SetSumBigIntSetter SetSumBigDecimalSetter }