Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Add(entityID flow.Identifier, entity flow.Entity) bool
- func (c *Cache) Adjust(entityID flow.Identifier, f func(flow.Entity) flow.Entity) (flow.Entity, bool)
- func (c Cache) All() map[flow.Identifier]flow.Entity
- func (c *Cache) ByID(entityID flow.Identifier) (flow.Entity, bool)
- func (c *Cache) Clear()
- func (c *Cache) Has(entityID flow.Identifier) bool
- func (c *Cache) Hash() flow.Identifier
- func (c *Cache) Rem(entityID flow.Identifier) (flow.Entity, bool)
- func (c Cache) Size() uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements an array-based generic memory pool backed by a fixed total array.
func (*Cache) Adjust ¶
func (c *Cache) Adjust(entityID flow.Identifier, f func(flow.Entity) flow.Entity) (flow.Entity, bool)
Adjust will adjust the value item using the given function if the given identifier can be found. Returns a bool which indicates whether the value was updated as well as the updated value.
func (Cache) All ¶
func (c Cache) All() map[flow.Identifier]flow.Entity
All returns all entities from the BackData.
func (*Cache) Has ¶
func (c *Cache) Has(entityID flow.Identifier) bool
Has checks if we already contain the entity with the given identifier.
func (*Cache) Hash ¶
func (c *Cache) Hash() flow.Identifier
Hash will use a merkle root hash to hash all items.
Click to show internal directories.
Click to hide internal directories.