Documentation ¶
Index ¶
- Variables
- func DockerCompose(t *testing.T, path, service string, wait time.Duration)
- func MigrateAccountCreated[K eventsourcing.ID](e *eventsourcing.Event[K], codec eventsourcing.Codec[K]) (*eventsourcing.EventMigration, error)
- func MigrateOwnerUpdated[K eventsourcing.ID](e *eventsourcing.Event[K], codec eventsourcing.Codec[K]) (*eventsourcing.EventMigration, error)
- func NewID(entropy *ulid.MonotonicEntropy) eventid.EventID
- func NewJSONCodec() *jsoncodec.Codec[ids.AggID]
- func NewJSONCodecWithUpcaster() *jsoncodec.Codec[ids.AggID]
- type Account
- func (a *Account) Balance() int64
- func (a *Account) Deposit(money int64) error
- func (a *Account) Forget()
- func (a *Account) GetKind() eventsourcing.Kind
- func (a *Account) Owner() string
- func (a *Account) Status() Status
- func (a *Account) UpdateOwner(owner string) error
- func (a *Account) Withdraw(money int64) (bool, error)
- type AccountCreated
- type AccountCreatedV2
- type AccountV2
- func (a *AccountV2) Balance() int64
- func (a *AccountV2) Deposit(money int64) error
- func (a *AccountV2) GetKind() eventsourcing.Kind
- func (a *AccountV2) Owner() NameVO
- func (a *AccountV2) Status() Status
- func (a *AccountV2) UpdateOwner(owner string) error
- func (a *AccountV2) Withdraw(money int64) (bool, error)
- type Cursor
- type InMemDB
- func (db *InMemDB[K]) Add(event *eventsourcing.Event[K]) *eventsourcing.Event[K]
- func (db *InMemDB[K]) GetEvents(ctx context.Context, afterEventID eventid.EventID, ...) ([]*eventsourcing.Event[K], error)
- func (db *InMemDB[K]) GetFrom(id eventid.EventID) []*eventsourcing.Event[K]
- func (db *InMemDB[K]) ReadAt(idx int) (*eventsourcing.Event[K], bool)
- func (db *InMemDB[K]) RemoveCursor(c *Cursor[K])
- func (db *InMemDB[K]) WatchAfter(resumeToken []byte) (*Cursor[K], error)
- type InMemDBFeed
- type InMemLocker
- type InMemLockerPool
- type InMemMemberList
- type InMemResumeStore
- type MockSinkClient
- func (s *MockSinkClient[K]) Accepts(hash uint32) bool
- func (s *MockSinkClient[K]) Close()
- func (s *MockSinkClient[K]) OnSink(handler func(ctx context.Context, e *eventsourcing.Event[K]) error)
- func (s *MockSinkClient[K]) Partitions() (uint32, []uint32)
- func (s *MockSinkClient[K]) ResumeTokens(ctx context.Context, forEach func(resumeToken encoding.Base64) error) error
- func (s *MockSinkClient[K]) Sink(ctx context.Context, e *eventsourcing.Event[K], m sink.Meta) error
- type MockSinkData
- type MoneyDeposited
- type MoneyWithdrawn
- type NameVO
- type OwnerUpdated
- type OwnerUpdatedV2
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( KindAccount = eventsourcing.Kind("Account") KindAccountCreated = eventsourcing.Kind("AccountCreated") KindMoneyDeposited = eventsourcing.Kind("MoneyDeposited") KindMoneyWithdrawn = eventsourcing.Kind("MoneyWithdrawn") KindOwnerUpdated = eventsourcing.Kind("OwnerUpdated") )
View Source
var ( KindAccountV2 = eventsourcing.Kind("Account_V2") KindAccountCreatedV2 = eventsourcing.Kind("AccountCreated_V2") KindOwnerUpdatedV2 = eventsourcing.Kind("OwnerUpdated_V2") )
Functions ¶
func DockerCompose ¶ added in v0.34.0
func MigrateAccountCreated ¶ added in v0.21.0
func MigrateAccountCreated[K eventsourcing.ID](e *eventsourcing.Event[K], codec eventsourcing.Codec[K]) (*eventsourcing.EventMigration, error)
func MigrateOwnerUpdated ¶ added in v0.21.0
func MigrateOwnerUpdated[K eventsourcing.ID](e *eventsourcing.Event[K], codec eventsourcing.Codec[K]) (*eventsourcing.EventMigration, error)
Types ¶
type Account ¶
type Account struct { eventsourcing.RootAggregate[ids.AggID] // contains filtered or unexported fields }
func DehydratedAccount ¶ added in v0.34.0
func (*Account) GetKind ¶ added in v0.28.0
func (a *Account) GetKind() eventsourcing.Kind
func (*Account) UpdateOwner ¶
type AccountCreated ¶
func (*AccountCreated) GetKind ¶ added in v0.28.0
func (e *AccountCreated) GetKind() eventsourcing.Kind
type AccountCreatedV2 ¶ added in v0.21.0
func (*AccountCreatedV2) GetKind ¶ added in v0.28.0
func (e *AccountCreatedV2) GetKind() eventsourcing.Kind
type AccountV2 ¶ added in v0.21.0
type AccountV2 struct { eventsourcing.RootAggregate[ids.AggID] // contains filtered or unexported fields }
func DehydratedAccountV2 ¶ added in v0.35.0
func NewAccountV2 ¶ added in v0.21.0
func (*AccountV2) GetKind ¶ added in v0.28.0
func (a *AccountV2) GetKind() eventsourcing.Kind
func (*AccountV2) UpdateOwner ¶ added in v0.21.0
type Cursor ¶ added in v0.25.0
type Cursor[K eventsourcing.ID] struct { // contains filtered or unexported fields }
type InMemDB ¶ added in v0.25.0
type InMemDB[K eventsourcing.ID] struct { // contains filtered or unexported fields }
func NewInMemDB ¶ added in v0.25.0
func NewInMemDB[K eventsourcing.ID]() *InMemDB[K]
func (*InMemDB[K]) Add ¶ added in v0.25.0
func (db *InMemDB[K]) Add(event *eventsourcing.Event[K]) *eventsourcing.Event[K]
func (*InMemDB[K]) GetFrom ¶ added in v0.25.0
func (db *InMemDB[K]) GetFrom(id eventid.EventID) []*eventsourcing.Event[K]
func (*InMemDB[K]) ReadAt ¶ added in v0.25.0
func (db *InMemDB[K]) ReadAt(idx int) (*eventsourcing.Event[K], bool)
func (*InMemDB[K]) RemoveCursor ¶ added in v0.25.0
type InMemDBFeed ¶ added in v0.25.0
type InMemDBFeed[K eventsourcing.ID] struct { // contains filtered or unexported fields }
func InMemDBNewFeed ¶ added in v0.25.0
func InMemDBNewFeed[K eventsourcing.ID](db *InMemDB[K], sinker sink.Sinker[K]) InMemDBFeed[K]
type InMemLocker ¶ added in v0.25.0
type InMemLocker struct {
// contains filtered or unexported fields
}
func (*InMemLocker) WaitForLock ¶ added in v0.31.0
func (*InMemLocker) WaitForUnlock ¶ added in v0.25.0
func (l *InMemLocker) WaitForUnlock(context.Context) error
type InMemLockerPool ¶ added in v0.25.0
type InMemLockerPool struct {
// contains filtered or unexported fields
}
func NewInMemLockerPool ¶ added in v0.25.0
func NewInMemLockerPool() *InMemLockerPool
func (*InMemLockerPool) NewLock ¶ added in v0.25.0
func (l *InMemLockerPool) NewLock(name string) *InMemLocker
type InMemMemberList ¶ added in v0.25.0
type InMemMemberList struct {
// contains filtered or unexported fields
}
func NewInMemMemberList ¶ added in v0.25.0
func NewInMemMemberList(ctx context.Context, db *sync.Map) *InMemMemberList
func (*InMemMemberList) Close ¶ added in v0.39.0
func (m *InMemMemberList) Close(_ context.Context) error
func (InMemMemberList) Name ¶ added in v0.25.0
func (m InMemMemberList) Name() string
type InMemResumeStore ¶ added in v0.25.0
type InMemResumeStore struct {
// contains filtered or unexported fields
}
func NewInMemResumeStore ¶ added in v0.25.0
func NewInMemResumeStore() *InMemResumeStore
func (*InMemResumeStore) GetStreamResumeToken ¶ added in v0.25.0
func (s *InMemResumeStore) GetStreamResumeToken(ctx context.Context, key projection.ResumeKey) (string, error)
func (*InMemResumeStore) SetStreamResumeToken ¶ added in v0.25.0
func (s *InMemResumeStore) SetStreamResumeToken(ctx context.Context, key projection.ResumeKey, token string) error
type MockSinkClient ¶ added in v0.34.0
type MockSinkClient[K eventsourcing.ID] struct { // contains filtered or unexported fields }
func NewMockSink ¶
func NewMockSink[K eventsourcing.ID](data *MockSinkData[K], partitions, partitionsLow, partitionHi uint32) *MockSinkClient[K]
func (*MockSinkClient[K]) Accepts ¶ added in v0.34.0
func (s *MockSinkClient[K]) Accepts(hash uint32) bool
func (*MockSinkClient[K]) Close ¶ added in v0.34.0
func (s *MockSinkClient[K]) Close()
func (*MockSinkClient[K]) OnSink ¶ added in v0.34.0
func (s *MockSinkClient[K]) OnSink(handler func(ctx context.Context, e *eventsourcing.Event[K]) error)
func (*MockSinkClient[K]) Partitions ¶ added in v0.34.0
func (s *MockSinkClient[K]) Partitions() (uint32, []uint32)
func (*MockSinkClient[K]) ResumeTokens ¶ added in v0.34.0
func (*MockSinkClient[K]) Sink ¶ added in v0.34.0
func (s *MockSinkClient[K]) Sink(ctx context.Context, e *eventsourcing.Event[K], m sink.Meta) error
type MockSinkData ¶ added in v0.34.0
type MockSinkData[K eventsourcing.ID] struct { // contains filtered or unexported fields }
func NewMockSinkData ¶ added in v0.34.0
func NewMockSinkData[K eventsourcing.ID]() *MockSinkData[K]
func (*MockSinkData[K]) GetEvents ¶ added in v0.34.0
func (s *MockSinkData[K]) GetEvents() []*sink.Message[K]
func (*MockSinkData[K]) LastResumes ¶ added in v0.34.0
func (s *MockSinkData[K]) LastResumes() map[uint32]encoding.Base64
func (*MockSinkData[K]) SetLastResumes ¶ added in v0.34.0
func (s *MockSinkData[K]) SetLastResumes(lastEvents map[uint32]encoding.Base64)
type MoneyDeposited ¶
type MoneyDeposited struct {
Money int64
}
func (*MoneyDeposited) GetKind ¶ added in v0.28.0
func (e *MoneyDeposited) GetKind() eventsourcing.Kind
type MoneyWithdrawn ¶
type MoneyWithdrawn struct {
Money int64
}
func (*MoneyWithdrawn) GetKind ¶ added in v0.28.0
func (e *MoneyWithdrawn) GetKind() eventsourcing.Kind
type OwnerUpdated ¶
type OwnerUpdated struct {
Owner string
}
func (*OwnerUpdated) GetKind ¶ added in v0.28.0
func (e *OwnerUpdated) GetKind() eventsourcing.Kind
type OwnerUpdatedV2 ¶ added in v0.21.0
type OwnerUpdatedV2 struct {
Owner NameVO
}
func (*OwnerUpdatedV2) GetKind ¶ added in v0.28.0
func (e *OwnerUpdatedV2) GetKind() eventsourcing.Kind
Source Files ¶
Click to show internal directories.
Click to hide internal directories.