Documentation
¶
Index ¶
- Variables
- func MigrateDown(db *sql.DB) error
- func MigrateUp(db *sql.DB) error
- func WrapError(msg string, err error) error
- func WrapErrorf(msg string, err error, args ...any) error
- type AddAggregateWithNaturalKeyParams
- type AddEventParams
- type AddSnapshotParams
- type AddSubscriptionEventTypeParams
- type AdvanceSubscriptionCursorParams
- type Aggregate
- type AggregateType
- type ChangeAggregateNaturalKeyParams
- type ClaimSubscriptionParams
- type DBTX
- type Event
- type EventType
- type GetAggregateByIdParams
- type GetAggregateByIdRow
- type GetAggregateIdByNaturalKeyParams
- type GetEventsForAggregateParams
- type GetEventsForAggregateRow
- type GetMostRecentSnapshotRow
- type GetSubscriptionByNameRow
- type PostgresStorageEngine
- func (s *PostgresStorageEngine) AddSubscriptionEventType(tx evercore.StorageEngineTxInfo, ctx context.Context, subscriptionId int64, ...) error
- func (s *PostgresStorageEngine) AdvanceSubscriptionCursor(tx evercore.StorageEngineTxInfo, ctx context.Context, id int64, ...) error
- func (s *PostgresStorageEngine) ChangeAggregateNaturalKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64, ...) error
- func (s *PostgresStorageEngine) ClaimSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, name string, ...) (bool, error)
- func (s *PostgresStorageEngine) Close() error
- func (s *PostgresStorageEngine) GetAggregateById(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, ...) (int64, *string, error)
- func (s *PostgresStorageEngine) GetAggregateByKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, ...) (int64, error)
- func (s *PostgresStorageEngine) GetAggregateTypeId(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeName string) (int64, error)
- func (s *PostgresStorageEngine) GetAggregateTypes(tx evercore.StorageEngineTxInfo, ctx context.Context) ([]evercore.IdNamePair, error)
- func (s *PostgresStorageEngine) GetEventTypeId(tx evercore.StorageEngineTxInfo, ctx context.Context, name string) (int64, error)
- func (s *PostgresStorageEngine) GetEventTypes(tx evercore.StorageEngineTxInfo, ctx context.Context) ([]evercore.IdNamePair, error)
- func (s *PostgresStorageEngine) GetEventsForAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64, ...) ([]evercore.SerializedEvent, error)
- func (s *PostgresStorageEngine) GetEventsForSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, ...) ([]evercore.SerializedEvent, error)
- func (s *PostgresStorageEngine) GetFirstEventIdFromTimestamp(tx evercore.StorageEngineTxInfo, ctx context.Context, ts time.Time) (int64, error)
- func (s *PostgresStorageEngine) GetMaxEventId(tx evercore.StorageEngineTxInfo, ctx context.Context) (int64, error)
- func (stor *PostgresStorageEngine) GetMaxKeyLength() int
- func (s *PostgresStorageEngine) GetOrCreateAggregateByKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, ...) (bool, int64, error)
- func (s *PostgresStorageEngine) GetSnapshotForAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64) (*evercore.Snapshot, error)
- func (s *PostgresStorageEngine) GetSubscriptionByName(tx evercore.StorageEngineTxInfo, ctx context.Context, name string) (*evercore.Subscription, error)
- func (s *PostgresStorageEngine) GetTransactionInfo() (evercore.StorageEngineTxInfo, error)
- func (s *PostgresStorageEngine) NewAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64) (int64, error)
- func (s *PostgresStorageEngine) NewAggregateWithKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, ...) (int64, error)
- func (s *PostgresStorageEngine) ReleaseSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, name string, ...) error
- func (s *PostgresStorageEngine) RenewSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, name string, ...) (bool, error)
- func (s *PostgresStorageEngine) SetSubscriptionActive(tx evercore.StorageEngineTxInfo, ctx context.Context, id int64, active bool) error
- func (s *PostgresStorageEngine) UpsertSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, name string, ...) (int64, error)
- func (s *PostgresStorageEngine) WriteState(tx evercore.StorageEngineTxInfo, ctx context.Context, ...) error
- type Queries
- func (q *Queries) AddAggregate(ctx context.Context, aggregateTypeID int64) (int64, error)
- func (q *Queries) AddAggregateType(ctx context.Context, aggregateTypeName string) (int64, error)
- func (q *Queries) AddAggregateWithNaturalKey(ctx context.Context, arg AddAggregateWithNaturalKeyParams) (int64, error)
- func (q *Queries) AddEvent(ctx context.Context, arg AddEventParams) error
- func (q *Queries) AddEventType(ctx context.Context, eventName string) (int64, error)
- func (q *Queries) AddSnapshot(ctx context.Context, arg AddSnapshotParams) error
- func (q *Queries) AddSubscriptionEventType(ctx context.Context, arg AddSubscriptionEventTypeParams) error
- func (q *Queries) AdvanceSubscriptionCursor(ctx context.Context, arg AdvanceSubscriptionCursorParams) error
- func (q *Queries) ChangeAggregateNaturalKey(ctx context.Context, arg ChangeAggregateNaturalKeyParams) error
- func (q *Queries) ClaimSubscription(ctx context.Context, arg ClaimSubscriptionParams) (int64, error)
- func (q *Queries) GetAggregateById(ctx context.Context, arg GetAggregateByIdParams) (GetAggregateByIdRow, error)
- func (q *Queries) GetAggregateIdByNaturalKey(ctx context.Context, arg GetAggregateIdByNaturalKeyParams) (int64, error)
- func (q *Queries) GetAggregateTypeIdByName(ctx context.Context, aggregateTypeName string) (int64, error)
- func (q *Queries) GetAggregateTypes(ctx context.Context) ([]AggregateType, error)
- func (q *Queries) GetEventTypeIdByName(ctx context.Context, eventName string) (int64, error)
- func (q *Queries) GetEventTypes(ctx context.Context) ([]EventType, error)
- func (q *Queries) GetEventsForAggregate(ctx context.Context, arg GetEventsForAggregateParams) ([]GetEventsForAggregateRow, error)
- func (q *Queries) GetFirstEventIdFromTimestamp(ctx context.Context, ts time.Time) (int64, error)
- func (q *Queries) GetMaxEventId(ctx context.Context) (interface{}, error)
- func (q *Queries) GetMostRecentSnapshot(ctx context.Context, aggregateID int64) (GetMostRecentSnapshotRow, error)
- func (q *Queries) GetSubscriptionByName(ctx context.Context, name string) (GetSubscriptionByNameRow, error)
- func (q *Queries) ReleaseSubscription(ctx context.Context, arg ReleaseSubscriptionParams) error
- func (q *Queries) RenewSubscription(ctx context.Context, arg RenewSubscriptionParams) (int64, error)
- func (q *Queries) SetSubscriptionActive(ctx context.Context, arg SetSubscriptionActiveParams) error
- func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) (int64, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type ReleaseSubscriptionParams
- type RenewSubscriptionParams
- type SetSubscriptionActiveParams
- type Snapshot
- type Subscription
- type SubscriptionEventType
- type UpsertSubscriptionParams
Constants ¶
This section is empty.
Variables ¶
View Source
var EmbeddedSqliteMigrations embed.FS
Functions ¶
func MigrateDown ¶
Types ¶
type AddAggregateWithNaturalKeyParams ¶
type AddAggregateWithNaturalKeyParams struct {
AggregateTypeID int64
NaturalKey sql.NullString
}
type AddEventParams ¶
type AddSnapshotParams ¶
type AddSubscriptionEventTypeParams ¶ added in v0.0.42
type AdvanceSubscriptionCursorParams ¶ added in v0.0.42
type AggregateType ¶
type ChangeAggregateNaturalKeyParams ¶ added in v0.0.33
type ChangeAggregateNaturalKeyParams struct {
NaturalKey sql.NullString
AggregateID int64
}
type ClaimSubscriptionParams ¶ added in v0.0.42
type GetAggregateByIdParams ¶
type GetAggregateByIdRow ¶
type GetAggregateByIdRow struct {
ID int64
NaturalKey sql.NullString
}
type GetAggregateIdByNaturalKeyParams ¶
type GetAggregateIdByNaturalKeyParams struct {
AggregateTypeID int64
NaturalKey sql.NullString
}
type GetSubscriptionByNameRow ¶ added in v0.0.42
type PostgresStorageEngine ¶
type PostgresStorageEngine struct {
// contains filtered or unexported fields
}
func NewPostgresStorageEngine ¶
func NewPostgresStorageEngine(db *sql.DB) *PostgresStorageEngine
func NewPostgresStorageEngineWithConnection ¶
func NewPostgresStorageEngineWithConnection(connectionString string) (*PostgresStorageEngine, error)
Creates a new Postgres backed storage engine.
func (*PostgresStorageEngine) AddSubscriptionEventType ¶ added in v0.0.42
func (s *PostgresStorageEngine) AddSubscriptionEventType(tx evercore.StorageEngineTxInfo, ctx context.Context, subscriptionId int64, eventTypeId int64) error
func (*PostgresStorageEngine) AdvanceSubscriptionCursor ¶ added in v0.0.42
func (s *PostgresStorageEngine) AdvanceSubscriptionCursor(tx evercore.StorageEngineTxInfo, ctx context.Context, id int64, lastEventId int64) error
func (*PostgresStorageEngine) ChangeAggregateNaturalKey ¶ added in v0.0.33
func (s *PostgresStorageEngine) ChangeAggregateNaturalKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64, naturalKey string) error
func (*PostgresStorageEngine) ClaimSubscription ¶ added in v0.0.42
func (*PostgresStorageEngine) Close ¶ added in v0.0.30
func (s *PostgresStorageEngine) Close() error
func (*PostgresStorageEngine) GetAggregateById ¶
func (s *PostgresStorageEngine) GetAggregateById(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, aggregateId int64) (int64, *string, error)
func (*PostgresStorageEngine) GetAggregateByKey ¶
func (s *PostgresStorageEngine) GetAggregateByKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, naturalKey string) (int64, error)
func (*PostgresStorageEngine) GetAggregateTypeId ¶
func (s *PostgresStorageEngine) GetAggregateTypeId(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeName string) (int64, error)
func (*PostgresStorageEngine) GetAggregateTypes ¶
func (s *PostgresStorageEngine) GetAggregateTypes(tx evercore.StorageEngineTxInfo, ctx context.Context) ([]evercore.IdNamePair, error)
func (*PostgresStorageEngine) GetEventTypeId ¶
func (s *PostgresStorageEngine) GetEventTypeId(tx evercore.StorageEngineTxInfo, ctx context.Context, name string) (int64, error)
func (*PostgresStorageEngine) GetEventTypes ¶
func (s *PostgresStorageEngine) GetEventTypes(tx evercore.StorageEngineTxInfo, ctx context.Context) ([]evercore.IdNamePair, error)
func (*PostgresStorageEngine) GetEventsForAggregate ¶
func (s *PostgresStorageEngine) GetEventsForAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64, afterSequence int64) ([]evercore.SerializedEvent, error)
func (*PostgresStorageEngine) GetEventsForSubscription ¶ added in v0.0.42
func (s *PostgresStorageEngine) GetEventsForSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, sub *evercore.Subscription, limit int) ([]evercore.SerializedEvent, error)
func (*PostgresStorageEngine) GetFirstEventIdFromTimestamp ¶ added in v0.0.42
func (s *PostgresStorageEngine) GetFirstEventIdFromTimestamp(tx evercore.StorageEngineTxInfo, ctx context.Context, ts time.Time) (int64, error)
func (*PostgresStorageEngine) GetMaxEventId ¶ added in v0.0.42
func (s *PostgresStorageEngine) GetMaxEventId(tx evercore.StorageEngineTxInfo, ctx context.Context) (int64, error)
func (*PostgresStorageEngine) GetMaxKeyLength ¶
func (stor *PostgresStorageEngine) GetMaxKeyLength() int
func (*PostgresStorageEngine) GetOrCreateAggregateByKey ¶
func (s *PostgresStorageEngine) GetOrCreateAggregateByKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, naturalKey string) (bool, int64, error)
func (*PostgresStorageEngine) GetSnapshotForAggregate ¶
func (s *PostgresStorageEngine) GetSnapshotForAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateId int64) (*evercore.Snapshot, error)
func (*PostgresStorageEngine) GetSubscriptionByName ¶ added in v0.0.42
func (s *PostgresStorageEngine) GetSubscriptionByName(tx evercore.StorageEngineTxInfo, ctx context.Context, name string) (*evercore.Subscription, error)
func (*PostgresStorageEngine) GetTransactionInfo ¶
func (s *PostgresStorageEngine) GetTransactionInfo() (evercore.StorageEngineTxInfo, error)
func (*PostgresStorageEngine) NewAggregate ¶
func (s *PostgresStorageEngine) NewAggregate(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64) (int64, error)
func (*PostgresStorageEngine) NewAggregateWithKey ¶
func (s *PostgresStorageEngine) NewAggregateWithKey(tx evercore.StorageEngineTxInfo, ctx context.Context, aggregateTypeId int64, naturalKey string) (int64, error)
func (*PostgresStorageEngine) ReleaseSubscription ¶ added in v0.0.42
func (s *PostgresStorageEngine) ReleaseSubscription(tx evercore.StorageEngineTxInfo, ctx context.Context, name string, owner string) error
func (*PostgresStorageEngine) RenewSubscription ¶ added in v0.0.42
func (*PostgresStorageEngine) SetSubscriptionActive ¶ added in v0.0.42
func (s *PostgresStorageEngine) SetSubscriptionActive(tx evercore.StorageEngineTxInfo, ctx context.Context, id int64, active bool) error
func (*PostgresStorageEngine) UpsertSubscription ¶ added in v0.0.42
func (*PostgresStorageEngine) WriteState ¶
func (s *PostgresStorageEngine) WriteState(tx evercore.StorageEngineTxInfo, ctx context.Context, events []evercore.StorageEngineEvent, snapshots evercore.SnapshotSlice) error
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddAggregate ¶
Aggregate Queries
func (*Queries) AddAggregateType ¶
Aggregate Type Queries
func (*Queries) AddAggregateWithNaturalKey ¶
func (*Queries) AddEvent ¶
func (q *Queries) AddEvent(ctx context.Context, arg AddEventParams) error
Event Queries
func (*Queries) AddEventType ¶
Event Type Queries
func (*Queries) AddSnapshot ¶
func (q *Queries) AddSnapshot(ctx context.Context, arg AddSnapshotParams) error
func (*Queries) AddSubscriptionEventType ¶ added in v0.0.42
func (q *Queries) AddSubscriptionEventType(ctx context.Context, arg AddSubscriptionEventTypeParams) error
func (*Queries) AdvanceSubscriptionCursor ¶ added in v0.0.42
func (q *Queries) AdvanceSubscriptionCursor(ctx context.Context, arg AdvanceSubscriptionCursorParams) error
func (*Queries) ChangeAggregateNaturalKey ¶ added in v0.0.33
func (q *Queries) ChangeAggregateNaturalKey(ctx context.Context, arg ChangeAggregateNaturalKeyParams) error
func (*Queries) ClaimSubscription ¶ added in v0.0.42
func (*Queries) GetAggregateById ¶
func (q *Queries) GetAggregateById(ctx context.Context, arg GetAggregateByIdParams) (GetAggregateByIdRow, error)
func (*Queries) GetAggregateIdByNaturalKey ¶
func (*Queries) GetAggregateTypeIdByName ¶
func (*Queries) GetAggregateTypes ¶
func (q *Queries) GetAggregateTypes(ctx context.Context) ([]AggregateType, error)
func (*Queries) GetEventTypeIdByName ¶
func (*Queries) GetEventTypes ¶
func (*Queries) GetEventsForAggregate ¶
func (q *Queries) GetEventsForAggregate(ctx context.Context, arg GetEventsForAggregateParams) ([]GetEventsForAggregateRow, error)
func (*Queries) GetFirstEventIdFromTimestamp ¶ added in v0.0.42
func (*Queries) GetMaxEventId ¶ added in v0.0.42
func (*Queries) GetMostRecentSnapshot ¶
func (*Queries) GetSubscriptionByName ¶ added in v0.0.42
func (*Queries) ReleaseSubscription ¶ added in v0.0.42
func (q *Queries) ReleaseSubscription(ctx context.Context, arg ReleaseSubscriptionParams) error
func (*Queries) RenewSubscription ¶ added in v0.0.42
func (*Queries) SetSubscriptionActive ¶ added in v0.0.42
func (q *Queries) SetSubscriptionActive(ctx context.Context, arg SetSubscriptionActiveParams) error
func (*Queries) UpsertSubscription ¶ added in v0.0.42
func (q *Queries) UpsertSubscription(ctx context.Context, arg UpsertSubscriptionParams) (int64, error)
Subscription Queries
type ReleaseSubscriptionParams ¶ added in v0.0.42
type ReleaseSubscriptionParams struct {
Name string
Owner sql.NullString
}
type RenewSubscriptionParams ¶ added in v0.0.42
type RenewSubscriptionParams struct {
LeaseExpiresAt sql.NullTime
Name string
Owner sql.NullString
}
type SetSubscriptionActiveParams ¶ added in v0.0.42
type Subscription ¶ added in v0.0.42
type Subscription struct {
ID int64
Name string
AggregateTypeID sql.NullInt64
EventTypeID sql.NullInt64
AggregateKey sql.NullString
StartFrom string
StartEventID int64
StartTimestamp sql.NullTime
LastEventID int64
Active bool
LeaseOwner sql.NullString
LeaseExpiresAt sql.NullTime
CreatedAt time.Time
UpdatedAt time.Time
}
type SubscriptionEventType ¶ added in v0.0.42
Click to show internal directories.
Click to hide internal directories.