Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WrappedEntity ¶
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
Click to show internal directories.
Click to hide internal directories.