Documentation
¶
Index ¶
- type Event
- type EventBuilder
- func (b *EventBuilder) Build() Event
- func (b *EventBuilder) WithAfter(after interface{}) *EventBuilder
- func (b *EventBuilder) WithBefore(before interface{}) *EventBuilder
- func (b *EventBuilder) WithOperation(op Operation) *EventBuilder
- func (b *EventBuilder) WithSource(source Source) *EventBuilder
- func (b *EventBuilder) WithTimestamp(ts int64) *EventBuilder
- func (b *EventBuilder) WithTransaction(tx *Transaction) *EventBuilder
- type Field
- type Operation
- type Payload
- type Schema
- type Source
- type SourceBuilder
- func (b *SourceBuilder) Build() Source
- func (b *SourceBuilder) WithDatabase(db string) *SourceBuilder
- func (b *SourceBuilder) WithSchema(schema string) *SourceBuilder
- func (b *SourceBuilder) WithTable(table string) *SourceBuilder
- func (b *SourceBuilder) WithTimestamp(ts int64) *SourceBuilder
- func (b *SourceBuilder) WithTransaction(txID int64, lsn int64) *SourceBuilder
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBuilder ¶
type EventBuilder struct {
// contains filtered or unexported fields
}
EventBuilder helps construct complete CDC events
func NewEventBuilder ¶
func NewEventBuilder() *EventBuilder
func (*EventBuilder) Build ¶
func (b *EventBuilder) Build() Event
func (*EventBuilder) WithAfter ¶
func (b *EventBuilder) WithAfter(after interface{}) *EventBuilder
func (*EventBuilder) WithBefore ¶
func (b *EventBuilder) WithBefore(before interface{}) *EventBuilder
func (*EventBuilder) WithOperation ¶
func (b *EventBuilder) WithOperation(op Operation) *EventBuilder
func (*EventBuilder) WithSource ¶
func (b *EventBuilder) WithSource(source Source) *EventBuilder
func (*EventBuilder) WithTimestamp ¶
func (b *EventBuilder) WithTimestamp(ts int64) *EventBuilder
func (*EventBuilder) WithTransaction ¶
func (b *EventBuilder) WithTransaction(tx *Transaction) *EventBuilder
type Field ¶
type Field struct { Field string `json:"field"` Type string `json:"type"` Optional bool `json:"optional"` Name string `json:"name,omitempty"` Fields []Field `json:"fields,omitempty"` }
Field represents a schema field definition
type Payload ¶
type Payload struct { Before interface{} `json:"before"` After interface{} `json:"after"` Source Source `json:"source"` Op Operation `json:"op"` TsMs int64 `json:"ts_ms"` Transaction *Transaction `json:"transaction,omitempty"` }
Payload represents the actual change data
type Schema ¶
type Schema struct { Type string `json:"type"` Optional bool `json:"optional"` Name string `json:"name"` Fields []Field `json:"fields"` }
Schema represents the schema definition for a change event
type Source ¶
type Source struct { Version string `json:"version"` Connector string `json:"connector"` Name string `json:"name"` TsMs int64 `json:"ts_ms"` Snapshot bool `json:"snapshot"` Db string `json:"db"` Sequence string `json:"sequence"` Schema string `json:"schema"` Table string `json:"table"` TxID int64 `json:"txId"` Lsn int64 `json:"lsn"` Xmin *int64 `json:"xmin,omitempty"` }
Source contains metadata about where a change originated
type SourceBuilder ¶
type SourceBuilder struct {
// contains filtered or unexported fields
}
SourceBuilder helps construct Source objects with reasonable defaults
func NewSourceBuilder ¶
func NewSourceBuilder(connector, name string) *SourceBuilder
func (*SourceBuilder) Build ¶
func (b *SourceBuilder) Build() Source
func (*SourceBuilder) WithDatabase ¶
func (b *SourceBuilder) WithDatabase(db string) *SourceBuilder
func (*SourceBuilder) WithSchema ¶
func (b *SourceBuilder) WithSchema(schema string) *SourceBuilder
func (*SourceBuilder) WithTable ¶
func (b *SourceBuilder) WithTable(table string) *SourceBuilder
func (*SourceBuilder) WithTimestamp ¶
func (b *SourceBuilder) WithTimestamp(ts int64) *SourceBuilder
func (*SourceBuilder) WithTransaction ¶
func (b *SourceBuilder) WithTransaction(txID int64, lsn int64) *SourceBuilder
type Transaction ¶
type Transaction struct { ID string `json:"id"` TotalOrder int64 `json:"total_order"` DataCollectionOrder int64 `json:"data_collection_order"` }
Transaction contains metadata about the transaction this change belongs to
Click to show internal directories.
Click to hide internal directories.