backdata

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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