Documentation ¶
Overview ¶
TODO: make subscription publishing related to tx commit instead to be commit on the fly
Index ¶
- Constants
- type IDGenerator
- type Memory
- func (s *Memory) AddEvent(event MemoryEvent)
- func (s *Memory) BeginTx(ctx context.Context) (context.Context, error)
- func (s *Memory) CommitTx(ctx context.Context) error
- func (s *Memory) Create(ctx context.Context, ptr interface{}) error
- func (s *Memory) DeleteAll(ctx context.Context, T interface{}) error
- func (s *Memory) DeleteByID(ctx context.Context, T, id interface{}) error
- func (s *Memory) EntityTypeNameFor(T interface{}) string
- func (s *Memory) Events() []MemoryEvent
- func (s *Memory) FindAll(ctx context.Context, T interface{}) iterators.Interface
- func (s *Memory) FindByID(ctx context.Context, ptr interface{}, id interface{}) (_found bool, _err error)
- func (s *Memory) IDGenerator() *IDGenerator
- func (s *Memory) InTx(ctx context.Context, fn func(tx *MemoryTransaction) error) error
- func (s *Memory) LogContextHistory(l logger, ctx context.Context)
- func (s *Memory) LogHistory(l logger)
- func (s *Memory) LookupTx(ctx context.Context) (*MemoryTransaction, bool)
- func (s *Memory) RollbackTx(ctx context.Context) error
- func (s *Memory) SubscribeToCreate(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
- func (s *Memory) SubscribeToDeleteAll(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
- func (s *Memory) SubscribeToDeleteByID(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
- func (s *Memory) SubscribeToUpdate(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
- func (s *Memory) Update(ctx context.Context, ptr interface{}) error
- type MemoryEvent
- type MemoryEventManager
- type MemoryEventViewer
- type MemoryTableView
- type MemoryTransaction
- type MemoryView
- type TraceElem
Constants ¶
View Source
const ( BeginTxEvent = `BeginTx` CommitTxEvent = `CommitTx` RollbackTxEvent = `RollbackTx` CreateEvent = `Create` UpdateEvent = `Update` DeleteAllEvent = `DeleteAll` DeleteByIDEvent = `DeleteByID` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶ added in v0.23.0
type Memory ¶ added in v0.11.0
type Memory struct { Options struct { DisableEventLogging bool DisableAsyncSubscriptionHandling bool DisableRelativePathResolvingForTrace bool } // 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 (*Memory) AddEvent ¶ added in v0.11.0
func (s *Memory) AddEvent(event MemoryEvent)
func (*Memory) DeleteByID ¶ added in v0.11.0
func (*Memory) EntityTypeNameFor ¶ added in v0.11.0
func (*Memory) Events ¶ added in v0.11.0
func (s *Memory) Events() []MemoryEvent
func (*Memory) IDGenerator ¶ added in v0.23.0
func (s *Memory) IDGenerator() *IDGenerator
func (*Memory) LogContextHistory ¶ added in v0.16.0
func (*Memory) LogHistory ¶ added in v0.16.0
func (s *Memory) LogHistory(l logger)
func (*Memory) LookupTx ¶ added in v0.17.0
func (s *Memory) LookupTx(ctx context.Context) (*MemoryTransaction, bool)
func (*Memory) SubscribeToCreate ¶ added in v0.11.0
func (s *Memory) SubscribeToCreate(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
func (*Memory) SubscribeToDeleteAll ¶ added in v0.11.0
func (s *Memory) SubscribeToDeleteAll(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
func (*Memory) SubscribeToDeleteByID ¶ added in v0.11.0
func (s *Memory) SubscribeToDeleteByID(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
func (*Memory) SubscribeToUpdate ¶ added in v0.11.0
func (s *Memory) SubscribeToUpdate(ctx context.Context, T interface{}, subscriber resources.Subscriber) (resources.Subscription, error)
type MemoryEvent ¶ added in v0.11.0
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 MemoryTableView ¶ added in v0.11.1
type MemoryTableView map[string]interface{} // id => entity <T>
func (MemoryTableView) FindByID ¶ added in v0.22.0
func (v MemoryTableView) FindByID(id interface{}) interface{}
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
func (tx *MemoryTransaction) View() MemoryView
func (*MemoryTransaction) ViewFor ¶ added in v0.11.1
func (tx *MemoryTransaction) ViewFor(T interface{}) MemoryTableView
type MemoryView ¶ added in v0.11.1
type MemoryView map[string]MemoryTableView // entity type name => table view
Click to show internal directories.
Click to hide internal directories.