Documentation
¶
Index ¶
- type ChangesetStore
- func (s *ChangesetStore) DeleteBeforeID(ctx context.Context, eventID int64) error
- func (s *ChangesetStore) DeleteBeforeTimestamp(ctx context.Context, ts time.Time) error
- func (s *ChangesetStore) GetByID(ctx context.Context, eventID int64) (*Event, error)
- func (s *ChangesetStore) GetSinceID(ctx context.Context, eventID int64, eventCh chan *Event, doneCh chan bool, ...)
- func (s *ChangesetStore) GetSinceTimestamp(ctx context.Context, since time.Time, eventCh chan *Event, doneCh chan bool, ...)
- type Event
- type EventStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangesetStore ¶
type ChangesetStore struct {
// contains filtered or unexported fields
}
ChangesetStore is an EventStore for changesets.
func NewChangesetStore ¶
func NewChangesetStore(conn *pgx.Conn) *ChangesetStore
NewChangesetStore initializes a new ChangesetStore.
func (*ChangesetStore) DeleteBeforeID ¶
func (s *ChangesetStore) DeleteBeforeID(ctx context.Context, eventID int64) error
DeleteBeforeID deletes all events before a given ID.
func (*ChangesetStore) DeleteBeforeTimestamp ¶
DeleteBeforeTimestamp deletes all events before a given timestamp.
func (*ChangesetStore) GetSinceID ¶
func (s *ChangesetStore) GetSinceID(ctx context.Context, eventID int64, eventCh chan *Event, doneCh chan bool, errCh chan error)
GetSinceID returns all events after a given ID.
func (*ChangesetStore) GetSinceTimestamp ¶
func (s *ChangesetStore) GetSinceTimestamp(ctx context.Context, since time.Time, eventCh chan *Event, doneCh chan bool, errCh chan error)
GetSinceTimestamp returns all events after a given timestamp.
type Event ¶
type Event struct {
ID int64
Timestamp time.Time
Action string
SchemaName string
TableName string
OID int64
NewValues []byte
OldValues []byte
}
Event represents an entry in the events store.
type EventStore ¶
type EventStore interface {
GetByID(ctx context.Context, eventID int64) (*Event, error)
GetSinceID(ctx context.Context, eventID int64, eventCh chan *Event, doneCh chan bool, errCh chan error)
GetSinceTimestamp(ctx context.Context, since time.Time, eventCh chan *Event, doneCh chan bool, errCh chan error)
DeleteBeforeID(ctx context.Context, eventID int64) error
DeleteBeforeTimestamp(ctx context.Context, since time.Time) error
}
EventStore is the interface for providing access to events storage.
Click to show internal directories.
Click to hide internal directories.