Documentation ¶
Index ¶
- Constants
- Variables
- type Change
- type Data
- type Metadata
- func (m Metadata) GetConduitDLQNackError() (string, error)
- func (m Metadata) GetConduitDLQNackNodeID() (string, error)
- func (m Metadata) GetConduitDestinationPluginName() (string, error)
- func (m Metadata) GetConduitDestinationPluginVersion() (string, error)
- func (m Metadata) GetConduitSourceConnectorID() (string, error)
- func (m Metadata) GetConduitSourcePluginName() (string, error)
- func (m Metadata) GetConduitSourcePluginVersion() (string, error)
- func (m Metadata) GetCreatedAt() (time.Time, error)
- func (m Metadata) GetOpenCDCVersion() (string, error)
- func (m Metadata) GetReadAt() (time.Time, error)
- func (m Metadata) SetConduitDLQNackError(err string)
- func (m Metadata) SetConduitDLQNackNodeID(id string)
- func (m Metadata) SetConduitDestinationPluginName(name string)
- func (m Metadata) SetConduitDestinationPluginVersion(version string)
- func (m Metadata) SetConduitSourceConnectorID(id string)
- func (m Metadata) SetConduitSourcePluginName(name string)
- func (m Metadata) SetConduitSourcePluginVersion(version string)
- func (m Metadata) SetCreatedAt(createdAt time.Time)
- func (m Metadata) SetOpenCDCVersion()
- func (m Metadata) SetReadAt(createdAt time.Time)
- type Operation
- type Position
- type RawData
- type Record
- type StructuredData
Constants ¶
const ( // OpenCDCVersion is a constant that should be used as the value in the // metadata field MetadataVersion. It ensures the OpenCDC format version can // be easily identified in case the record gets marshaled into a different // untyped format (e.g. JSON). OpenCDCVersion = "v1" // MetadataOpenCDCVersion is a Record.Metadata key for the version of the // OpenCDC format (e.g. "v1"). This field exists to ensure the OpenCDC // format version can be easily identified in case the record gets marshaled // into a different untyped format (e.g. JSON). MetadataOpenCDCVersion = "opencdc.version" // MetadataCreatedAt is a Record.Metadata key for the time when the record // was created in the 3rd party system. The expected format is a unix // timestamp in nanoseconds. MetadataCreatedAt = "opencdc.createdAt" // MetadataReadAt is a Record.Metadata key for the time when the record was // read from the 3rd party system. The expected format is a unix timestamp // in nanoseconds. MetadataReadAt = "opencdc.readAt" // MetadataConduitSourcePluginName is a Record.Metadata key for the name of // the source plugin that created this record. MetadataConduitSourcePluginName = "conduit.source.plugin.name" // MetadataConduitSourcePluginVersion is a Record.Metadata key for the // version of the source plugin that created this record. MetadataConduitSourcePluginVersion = "conduit.source.plugin.version" // MetadataConduitDestinationPluginName is a Record.Metadata key for the // name of the destination plugin that has written this record // (only available in records once they are written by a destination). MetadataConduitDestinationPluginName = "conduit.destination.plugin.name" // MetadataConduitDestinationPluginVersion is a Record.Metadata key for the // version of the destination plugin that has written this record // (only available in records once they are written by a destination). MetadataConduitDestinationPluginVersion = "conduit.destination.plugin.version" // MetadataConduitSourceConnectorID is a Record.Metadata key for the ID of // the source connector that received this record. MetadataConduitSourceConnectorID = "conduit.source.connector.id" // MetadataConduitDLQNackError is a Record.Metadata key for the error that // caused a record to be nacked and pushed to the dead-letter queue. MetadataConduitDLQNackError = "conduit.dlq.nack.error" // MetadataConduitDLQNackNodeID is a Record.Metadata key for the ID of the // internal node that nacked the record. MetadataConduitDLQNackNodeID = "conduit.dlq.nack.node.id" )
Variables ¶
var ( // ErrMetadataFieldNotFound is returned in metadata utility functions when a // metadata field is not found. ErrMetadataFieldNotFound = cerrors.New("metadata field not found") )
Functions ¶
This section is empty.
Types ¶
type Change ¶ added in v0.3.0
type Change struct { // Before contains the data before the operation occurred. This field is // optional and should only be populated for operations OperationUpdate // OperationDelete (if the system supports fetching the data before the // operation). Before Data `json:"before"` // After contains the data after the operation occurred. This field should // be populated for all operations except OperationDelete. After Data `json:"after"` }
type Data ¶
Data is a structure that contains some bytes. The only structs implementing Data are RawData and StructuredData.
type Metadata ¶ added in v0.3.0
func (Metadata) GetConduitDLQNackError ¶ added in v0.4.0
GetConduitDLQNackError returns the value for key MetadataConduitDLQNackError. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitDLQNackNodeID ¶ added in v0.4.0
GetConduitDLQNackNodeID returns the value for key MetadataConduitDLQNackNodeID. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitDestinationPluginName ¶ added in v0.4.0
GetConduitDestinationPluginName returns the value for key MetadataConduitDestinationPluginName. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitDestinationPluginVersion ¶ added in v0.4.0
GetConduitDestinationPluginVersion returns the value for key MetadataConduitDestinationPluginVersion. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitSourceConnectorID ¶ added in v0.4.0
GetConduitSourceConnectorID returns the value for key MetadataConduitSourceConnectorID. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitSourcePluginName ¶ added in v0.4.0
GetConduitSourcePluginName returns the value for key MetadataConduitSourcePluginName. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetConduitSourcePluginVersion ¶ added in v0.4.0
GetConduitSourcePluginVersion returns the value for key MetadataConduitSourcePluginVersion. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetCreatedAt ¶ added in v0.3.0
GetCreatedAt parses the value for key MetadataCreatedAt as a unix timestamp. If the value does not exist or the value is empty the function returns ErrMetadataFieldNotFound. If the value is not a valid unix timestamp in nanoseconds the function returns an error.
func (Metadata) GetOpenCDCVersion ¶ added in v0.3.0
GetOpenCDCVersion returns the value for key MetadataOpenCDCVersion. If the value does not exist or is empty the function returns ErrMetadataFieldNotFound.
func (Metadata) GetReadAt ¶ added in v0.3.0
GetReadAt parses the value for key MetadataReadAt as a unix timestamp. If the value does not exist or the value is empty the function returns ErrMetadataFieldNotFound. If the value is not a valid unix timestamp in nanoseconds the function returns an error.
func (Metadata) SetConduitDLQNackError ¶ added in v0.4.0
SetConduitDLQNackError sets the metadata value for key MetadataConduitDLQNackError.
func (Metadata) SetConduitDLQNackNodeID ¶ added in v0.4.0
SetConduitDLQNackNodeID sets the metadata value for key MetadataConduitDLQNackNodeID.
func (Metadata) SetConduitDestinationPluginName ¶ added in v0.4.0
SetConduitDestinationPluginName sets the metadata value for key MetadataConduitDestinationPluginName.
func (Metadata) SetConduitDestinationPluginVersion ¶ added in v0.4.0
SetConduitDestinationPluginVersion sets the metadata value for key MetadataConduitDestinationPluginVersion.
func (Metadata) SetConduitSourceConnectorID ¶ added in v0.4.0
SetConduitSourceConnectorID sets the metadata value for key MetadataConduitSourceConnectorID.
func (Metadata) SetConduitSourcePluginName ¶ added in v0.4.0
SetConduitSourcePluginName sets the metadata value for key MetadataConduitSourcePluginName.
func (Metadata) SetConduitSourcePluginVersion ¶ added in v0.4.0
SetConduitSourcePluginVersion sets the metadata value for key MetadataConduitSourcePluginVersion.
func (Metadata) SetCreatedAt ¶ added in v0.3.0
SetCreatedAt sets the metadata value for key MetadataCreatedAt as a unix timestamp in nanoseconds.
func (Metadata) SetOpenCDCVersion ¶ added in v0.3.0
func (m Metadata) SetOpenCDCVersion()
SetOpenCDCVersion sets the metadata value for key MetadataVersion to the current version of OpenCDC used.
type Operation ¶ added in v0.3.0
type Operation int
Operation defines what triggered the creation of a record.
func (Operation) MarshalText ¶ added in v0.3.0
func (*Operation) UnmarshalText ¶ added in v0.3.0
type Position ¶
type Position []byte
Position is a unique identifier for a record being process. It's a Source's responsibility to choose and assign record positions, as they will be used by the Source in subsequent pipeline runs.
type RawData ¶
type RawData struct {
Raw []byte
}
RawData contains unstructured data in form of a byte slice.
func (RawData) MarshalText ¶ added in v0.3.0
func (*RawData) UnmarshalText ¶ added in v0.3.0
type Record ¶
type Record struct { // Position uniquely represents the record. Position Position `json:"position"` // Operation defines what triggered the creation of a record. There are four // possibilities: create, update, delete or snapshot. The first three // operations are encountered during normal CDC operation, while "snapshot" // is meant to represent records during an initial load. Depending on the // operation, the record will contain either the payload before the change, // after the change, or both (see field Payload). Operation Operation `json:"operation"` // Metadata contains additional information regarding the record. Metadata Metadata `json:"metadata"` // Key represents a value that should identify the entity (e.g. database // row). Key Data `json:"key"` // Payload holds the payload change (data before and after the operation // occurred). Payload Change `json:"payload"` }
Record represents a single data record produced by a source and/or consumed by a destination connector.
func FromOpenCDC ¶ added in v0.9.0
type StructuredData ¶
type StructuredData map[string]interface{}
StructuredData contains data in form of a map with string keys and arbitrary values.
func (StructuredData) Bytes ¶
func (d StructuredData) Bytes() []byte
func (StructuredData) Clone ¶ added in v0.8.0
func (d StructuredData) Clone() Data