Documentation ¶
Index ¶
- Constants
- type Event
- type EventLog
- func (s *EventLog) AddSubscription(ctx context.Context, subscriber Subscriber) (frameless.Subscription, error)
- func (s *EventLog) Append(ctx context.Context, event Event) error
- func (s *EventLog) Atomic(ctx context.Context, fn func(tx *Tx) error) error
- func (s *EventLog) BeginTx(ctx context.Context) (context.Context, error)
- func (s *EventLog) CommitTx(ctx context.Context) error
- func (s *EventLog) Events() []Event
- func (s *EventLog) LookupTx(ctx context.Context) (*Tx, bool)
- func (s *EventLog) Rewrite(mapper func(es []Event) []Event)
- func (s *EventLog) RollbackTx(ctx context.Context) error
- type EventManager
- type EventViewer
- type Stack
- type Storage
- func (s *Storage) BeginTx(ctx context.Context) (context.Context, error)
- func (s *Storage) CommitTx(ctx context.Context) error
- func (s *Storage) CompressEvents()
- func (s *Storage) Create(ctx context.Context, ptr interface{}) error
- func (s *Storage) DeleteAll(ctx context.Context) error
- func (s *Storage) DeleteByID(ctx context.Context, id interface{}) error
- func (s *Storage) FindAll(ctx context.Context) frameless.Iterator
- func (s *Storage) FindByID(ctx context.Context, ptr interface{}, id interface{}) (_found bool, _err error)
- func (s *Storage) LookupTx(ctx context.Context) (*Tx, bool)
- func (s *Storage) RollbackTx(ctx context.Context) error
- func (s *Storage) SubscribeToCreate(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
- func (s *Storage) SubscribeToDeleteAll(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
- func (s *Storage) SubscribeToDeleteByID(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
- func (s *Storage) SubscribeToUpdate(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
- func (s *Storage) Update(ctx context.Context, ptr interface{}) error
- func (s *Storage) View(ctx context.Context) StorageView
- type StorageEventType
- type StorageEventValue
- type StorageView
- type StubSubscriber
- type Subscriber
- type Subscription
- type Tx
Constants ¶
View Source
const ( CreateEvent = `Create` UpdateEvent = `Update` DeleteAllEvent = `DeleteAll` DeleteByIDEvent = `DeleteByID` )
Name Types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶ added in v0.36.0
type Event struct { Type interface{} Value interface{} Trace []Stack }
type EventLog ¶ added in v0.36.0
type EventLog struct { Options struct { DisableAsyncSubscriptionHandling bool } // contains filtered or unexported fields }
EventLog is an event source principles based development in memory memory, that allows easy debugging and tracing during development for fast and descriptive feedback loops.
func NewEventLog ¶ added in v0.36.0
func NewEventLog() *EventLog
func (*EventLog) AddSubscription ¶ added in v0.36.0
func (s *EventLog) AddSubscription(ctx context.Context, subscriber Subscriber) (frameless.Subscription, error)
type EventManager ¶ added in v0.36.0
type EventManager interface { Append(context.Context, Event) error EventViewer }
type EventViewer ¶ added in v0.36.0
type EventViewer interface {
Events() []Event
}
type Storage ¶
type Storage struct { T interface{} EventLog *EventLog NewID func(ctx context.Context) (interface{}, error) Options struct { DisableEventLogging bool } // contains filtered or unexported fields }
Storage is an EventLog based development in memory storage, that allows easy debugging and tracing during development for fast and descriptive feedback loops.
func NewStorage ¶
func (*Storage) CompressEvents ¶ added in v0.36.0
func (s *Storage) CompressEvents()
func (*Storage) DeleteByID ¶
func (*Storage) SubscribeToCreate ¶
func (s *Storage) SubscribeToCreate(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
func (*Storage) SubscribeToDeleteAll ¶
func (s *Storage) SubscribeToDeleteAll(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
func (*Storage) SubscribeToDeleteByID ¶
func (s *Storage) SubscribeToDeleteByID(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
func (*Storage) SubscribeToUpdate ¶
func (s *Storage) SubscribeToUpdate(ctx context.Context, subscriber frameless.Subscriber) (frameless.Subscription, error)
type StorageEventType ¶ added in v0.36.0
type StorageEventType struct{ T interface{} }
type StorageEventValue ¶ added in v0.36.0
type StorageEventValue struct { Name string Value interface{} }
type StorageView ¶ added in v0.36.0
type StorageView map[string]interface{}
func (StorageView) FindByID ¶ added in v0.36.0
func (v StorageView) FindByID(id interface{}) (interface{}, bool)
type StubSubscriber ¶ added in v0.36.0
type StubSubscriber struct { HandleFunc func(ctx context.Context, event Event) error ErrorFunc func(ctx context.Context, err error) error }
type Subscriber ¶ added in v0.36.0
type Subscription ¶ added in v0.36.0
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶ added in v0.36.0
func (s *Subscription) Close() (rErr error)
Click to show internal directories.
Click to hide internal directories.