storages

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

TODO: make subscription publishing related to tx commit instead to be done on the fly

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History added in v0.10.0

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

History will return a list of the event history of the

func (History) LogWith added in v0.10.0

func (h History) LogWith(l interface{ Log(args ...interface{}) })

type Memory added in v0.11.0

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

Memory is an event source principles based development in memory storage, that allows easy debugging and tracing during development for fast and descriptive feedback loops.

func NewMemory added in v0.11.0

func NewMemory() *Memory

func (*Memory) AddEvent added in v0.11.0

func (s *Memory) AddEvent(event MemoryEvent)

func (*Memory) BeginTx added in v0.11.0

func (s *Memory) BeginTx(ctx context.Context) (context.Context, error)

func (*Memory) CommitTx added in v0.11.0

func (s *Memory) CommitTx(ctx context.Context) error

func (*Memory) Create added in v0.11.0

func (s *Memory) Create(ctx context.Context, ptr interface{}) error

func (*Memory) DeleteAll added in v0.11.0

func (s *Memory) DeleteAll(ctx context.Context, T interface{}) error

func (*Memory) DeleteByID added in v0.11.0

func (s *Memory) DeleteByID(ctx context.Context, T interface{}, id string) error

func (*Memory) DisableEventLogging added in v0.11.0

func (s *Memory) DisableEventLogging()

func (*Memory) EntityTypeNameFor added in v0.11.0

func (s *Memory) EntityTypeNameFor(T interface{}) string

func (*Memory) Events added in v0.11.0

func (s *Memory) Events() []MemoryEvent

func (*Memory) FindAll added in v0.11.0

func (s *Memory) FindAll(ctx context.Context, T interface{}) frameless.Iterator

func (*Memory) FindByID added in v0.11.0

func (s *Memory) FindByID(ctx context.Context, ptr interface{}, id string) (_found bool, _err error)

func (*Memory) History added in v0.11.0

func (s *Memory) History() History

func (*Memory) InTx added in v0.11.0

func (s *Memory) InTx(ctx context.Context, fn func(tx *MemoryTransaction) error) error

func (*Memory) RollbackTx added in v0.11.0

func (s *Memory) RollbackTx(ctx context.Context) error

func (*Memory) SubscribeToCreate added in v0.11.0

func (s *Memory) SubscribeToCreate(T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)

func (*Memory) SubscribeToDeleteAll added in v0.11.0

func (s *Memory) SubscribeToDeleteAll(T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)

func (*Memory) SubscribeToDeleteByID added in v0.11.0

func (s *Memory) SubscribeToDeleteByID(T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)

func (*Memory) SubscribeToUpdate added in v0.11.0

func (s *Memory) SubscribeToUpdate(T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)

func (*Memory) Update added in v0.11.0

func (s *Memory) Update(ctx context.Context, ptr interface{}) error

type MemoryEvent added in v0.11.0

type MemoryEvent struct {
	T              interface{}
	EntityTypeName string
	Event          string
	ID             string
	Entity         interface{}
	Trace          []string
}

type MemoryEventManager added in v0.11.0

type MemoryEventManager interface {
	AddEvent(MemoryEvent)
	MemoryEventViewer
}

type MemoryEventViewer added in v0.11.0

type MemoryEventViewer interface {
	Events() []MemoryEvent
}

type MemoryTransaction added in v0.11.0

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

func (*MemoryTransaction) AddEvent added in v0.11.0

func (tx *MemoryTransaction) AddEvent(event MemoryEvent)

func (MemoryTransaction) Events added in v0.11.0

func (tx MemoryTransaction) Events() []MemoryEvent

func (MemoryTransaction) View added in v0.11.0

type StorageEventView added in v0.10.0

type StorageEventView map[string]map[string]interface{} // entity type name => id => entity

Jump to

Keyboard shortcuts

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