Documentation ¶
Index ¶
- type MapBackData
- func (b *MapBackData) Add(entityID flow.Identifier, entity flow.Entity) bool
- func (b *MapBackData) Adjust(entityID flow.Identifier, f func(flow.Entity) flow.Entity) (flow.Entity, bool)
- func (b MapBackData) All() map[flow.Identifier]flow.Entity
- func (b MapBackData) ByID(entityID flow.Identifier) (flow.Entity, bool)
- func (b *MapBackData) Clear()
- func (b MapBackData) Has(entityID flow.Identifier) bool
- func (b *MapBackData) Hash() flow.Identifier
- func (b *MapBackData) Rem(entityID flow.Identifier) (flow.Entity, bool)
- func (b MapBackData) Size() uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapBackData ¶
type MapBackData struct {
// contains filtered or unexported fields
}
MapBackData implements a map-based generic memory BackData backed by a Go map.
func NewMapBackData ¶
func NewMapBackData() *MapBackData
func (*MapBackData) Add ¶
func (b *MapBackData) Add(entityID flow.Identifier, entity flow.Entity) bool
Add adds the given entity to the BackData.
func (*MapBackData) Adjust ¶
func (b *MapBackData) 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 key can be found. Returns a bool which indicates whether the value was updated as well as the updated value
func (MapBackData) All ¶
func (b MapBackData) All() map[flow.Identifier]flow.Entity
All returns all entities from the BackData.
func (MapBackData) ByID ¶
func (b MapBackData) ByID(entityID flow.Identifier) (flow.Entity, bool)
ByID returns the given item from the BackData.
func (*MapBackData) Clear ¶
func (b *MapBackData) Clear()
Clear removes all entities from the BackData.
func (MapBackData) Has ¶
func (b MapBackData) Has(entityID flow.Identifier) bool
Has checks if we already contain the item with the given identifier.
func (*MapBackData) Hash ¶
func (b *MapBackData) Hash() flow.Identifier
Hash will use a merkle root hash to hash all entities.
func (*MapBackData) Rem ¶
func (b *MapBackData) Rem(entityID flow.Identifier) (flow.Entity, bool)
Rem will remove the entity with the given identifier.
func (MapBackData) Size ¶
func (b MapBackData) Size() uint
Size will return the size of the BackData.