mem

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ent

type Ent = ent.Ent

type EntIterator added in v0.2.8

type EntIterator struct {
	IdIterator
	// contains filtered or unexported fields
}

func (*EntIterator) Err added in v0.2.8

func (it *EntIterator) Err() error

func (*EntIterator) Next added in v0.2.8

func (it *EntIterator) Next(e Ent) bool

type EntStorage

type EntStorage struct {
	// contains filtered or unexported fields
}

EntStorage is a generic, goroutine-safe storage implementation of ent.Storage which maintains ent data in memory, suitable for tests.

func NewEntStorage

func NewEntStorage() *EntStorage

func (*EntStorage) Create added in v0.2.8

func (s *EntStorage) Create(e Ent, fields ent.FieldSet) (id uint64, err error)

func (*EntStorage) Delete added in v0.2.8

func (s *EntStorage) Delete(e Ent, id uint64) error

func (*EntStorage) FindByIndex added in v0.2.8

func (s *EntStorage) FindByIndex(
	entTypeName string, x *ent.EntIndex, key []byte, limit int, flags ent.LookupFlags,
) ([]uint64, error)

func (*EntStorage) IterateEnts added in v0.2.8

func (s *EntStorage) IterateEnts(proto Ent) ent.EntIterator

func (*EntStorage) IterateIds added in v0.2.8

func (s *EntStorage) IterateIds(entType string) ent.IdIterator

func (*EntStorage) LoadById added in v0.2.8

func (s *EntStorage) LoadById(e Ent, id uint64) (version uint64, err error)

func (*EntStorage) LoadByIndex added in v0.2.8

func (s *EntStorage) LoadByIndex(
	e Ent, x *ent.EntIndex, key []byte, limit int, flags ent.LookupFlags,
) ([]Ent, error)

func (*EntStorage) Save added in v0.2.8

func (s *EntStorage) Save(e Ent, fields ent.FieldSet) (nextVersion uint64, err error)

type IdIterator added in v0.2.8

type IdIterator struct {
	// contains filtered or unexported fields
}

func (*IdIterator) Err added in v0.2.8

func (it *IdIterator) Err() error

func (*IdIterator) Next added in v0.2.8

func (it *IdIterator) Next(id *uint64) bool

type ScopedMap

type ScopedMap struct {
	// contains filtered or unexported fields
}

ScopedMap is like a map[string][]byte but prototypal in behaviour; local read misses causes a parent ScopedMap to be tried, while writes are always local. Sort of like a hacky HAMT map.

func (*ScopedMap) ApplyToOuter

func (s *ScopedMap) ApplyToOuter()

ApplyToOuter applies all entries (including deletes) of this scope to its outer scope. This effectively moves changes from this scope to the outer scope, clearing this scope.

func (*ScopedMap) Del

func (s *ScopedMap) Del(key string)

func (ScopedMap) Get

func (s ScopedMap) Get(key string) []byte

func (*ScopedMap) NewScope

func (s *ScopedMap) NewScope() *ScopedMap

func (*ScopedMap) Put

func (s *ScopedMap) Put(key string, value []byte)

Jump to

Keyboard shortcuts

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