internal

package
v0.31.14 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WrappedEntity

type WrappedEntity struct {
	flow.Entity
	// contains filtered or unexported fields
}

WrappedEntity is a wrapper around a flow.Entity that allows overriding the ID. The has 2 main use cases:

  • when the ID is expensive to compute, we can pre-compute it and use it for the cache
  • when caching an entity using a different ID than what's returned by ID(). For example, if there is a 1:1 mapping between a block and an entity, we can use the block ID as the cache key.

func NewWrappedEntity

func NewWrappedEntity(id flow.Identifier, entity flow.Entity) *WrappedEntity

NewWrappedEntity creates a new WrappedEntity

func (WrappedEntity) Checksum

func (w WrappedEntity) Checksum() flow.Identifier

Checksum returns th cached ID of the wrapped entity

func (WrappedEntity) ID

func (w WrappedEntity) ID() flow.Identifier

ID returns the cached ID of the wrapped entity

Jump to

Keyboard shortcuts

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