opencdcv1

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Operation_name = map[int32]string{
		0: "OPERATION_UNSPECIFIED",
		1: "OPERATION_CREATE",
		2: "OPERATION_UPDATE",
		3: "OPERATION_DELETE",
		4: "OPERATION_SNAPSHOT",
	}
	Operation_value = map[string]int32{
		"OPERATION_UNSPECIFIED": 0,
		"OPERATION_CREATE":      1,
		"OPERATION_UPDATE":      2,
		"OPERATION_DELETE":      3,
		"OPERATION_SNAPSHOT":    4,
	}
)

Enum value maps for Operation.

View Source
var (
	// OpenCDC version is a constant that should be used as the value in the
	// metadata field opencdc.version. It ensures the OpenCDC format version can be
	// easily identified in case the record gets marshaled into a different untyped
	// format (e.g. JSON).
	//
	// optional string opencdc_version = 9999;
	E_OpencdcVersion = &file_opencdc_v1_opencdc_proto_extTypes[0]
	// Metadata field "opencdc.version" contains 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).
	//
	// optional string metadata_version = 10000;
	E_MetadataVersion = &file_opencdc_v1_opencdc_proto_extTypes[1]
	// Metadata field "opencdc.createdAt" can contain the time when the record was
	// created in the 3rd party system. The expected format is a unix timestamp in
	// nanoseconds.
	//
	// optional string metadata_created_at = 10001;
	E_MetadataCreatedAt = &file_opencdc_v1_opencdc_proto_extTypes[2]
	// Metadata field "opencdc.readAt" can contain the time when the record was
	// read from the 3rd party system. The expected format is a unix timestamp in
	// nanoseconds.
	//
	// optional string metadata_read_at = 10002;
	E_MetadataReadAt = &file_opencdc_v1_opencdc_proto_extTypes[3]
	// Metadata field "opencdc.collection" can contain the name of the collection
	// where the record originated from and/or where it should be stored.
	//
	// optional string metadata_collection = 10003;
	E_MetadataCollection = &file_opencdc_v1_opencdc_proto_extTypes[4]
)

Extension fields to descriptorpb.FileOptions.

View Source
var File_opencdc_v1_opencdc_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Change

type Change struct {

	// Before contains the data before the operation occurred. This field is
	// optional and should only be populated for operations "update" and "delete"
	// (if the system supports fetching the data before the operation).
	Before *Data `protobuf:"bytes,1,opt,name=before,proto3" json:"before,omitempty"`
	// After contains the data after the operation occurred. This field should be
	// populated for all operations except "delete".
	After *Data `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"`
	// contains filtered or unexported fields
}

Change represents the data before and after the operation occurred.

func (*Change) Descriptor deprecated

func (*Change) Descriptor() ([]byte, []int)

Deprecated: Use Change.ProtoReflect.Descriptor instead.

func (*Change) GetAfter

func (x *Change) GetAfter() *Data

func (*Change) GetBefore

func (x *Change) GetBefore() *Data

func (*Change) ProtoMessage

func (*Change) ProtoMessage()

func (*Change) ProtoReflect

func (x *Change) ProtoReflect() protoreflect.Message

func (*Change) Reset

func (x *Change) Reset()

func (*Change) String

func (x *Change) String() string

type Data

type Data struct {

	// Types that are assignable to Data:
	//
	//	*Data_RawData
	//	*Data_StructuredData
	Data isData_Data `protobuf_oneof:"data"`
	// contains filtered or unexported fields
}

Data is used to represent the record key and payload. It can be either raw data (byte array) or structured data (struct).

func (*Data) Descriptor deprecated

func (*Data) Descriptor() ([]byte, []int)

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetData

func (m *Data) GetData() isData_Data

func (*Data) GetRawData

func (x *Data) GetRawData() []byte

func (*Data) GetStructuredData

func (x *Data) GetStructuredData() *structpb.Struct

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect

func (x *Data) ProtoReflect() protoreflect.Message

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

type Data_RawData

type Data_RawData struct {
	// Raw data contains unstructured data in form of a byte array.
	RawData []byte `protobuf:"bytes,1,opt,name=raw_data,json=rawData,proto3,oneof"`
}

type Data_StructuredData

type Data_StructuredData struct {
	// Structured data contains data in form of a struct with fields.
	StructuredData *structpb.Struct `protobuf:"bytes,2,opt,name=structured_data,json=structuredData,proto3,oneof"`
}

type Operation

type Operation int32

Operation defines what triggered the creation of a record.

const (
	Operation_OPERATION_UNSPECIFIED Operation = 0
	// Records with operation create contain data of a newly created entity.
	Operation_OPERATION_CREATE Operation = 1
	// Records with operation update contain data of an updated entity.
	Operation_OPERATION_UPDATE Operation = 2
	// Records with operation delete contain data of a deleted entity.
	Operation_OPERATION_DELETE Operation = 3
	// Records with operation snapshot contain data of a previously existing
	// entity, fetched as part of a snapshot.
	Operation_OPERATION_SNAPSHOT Operation = 4
)

func (Operation) Descriptor

func (Operation) Descriptor() protoreflect.EnumDescriptor

func (Operation) Enum

func (x Operation) Enum() *Operation

func (Operation) EnumDescriptor deprecated

func (Operation) EnumDescriptor() ([]byte, []int)

Deprecated: Use Operation.Descriptor instead.

func (Operation) Number

func (x Operation) Number() protoreflect.EnumNumber

func (Operation) String

func (x Operation) String() string

func (Operation) Type

type Record

type Record struct {

	// Position uniquely identifies the record.
	Position []byte `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// 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 `protobuf:"varint,2,opt,name=operation,proto3,enum=opencdc.v1.Operation" json:"operation,omitempty"`
	// Metadata contains optional information related to the record. Although the
	// map can contain arbitrary keys, the standard provides a set of standard
	// metadata fields (see options prefixed with metadata_*).
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// Key represents a value that should identify the entity (e.g. database row).
	Key *Data `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// Payload holds the payload change (data before and after the operation
	// occurred).
	Payload *Change `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Record contains data about a single change event related to a single entity.

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetKey

func (x *Record) GetKey() *Data

func (*Record) GetMetadata

func (x *Record) GetMetadata() map[string]string

func (*Record) GetOperation

func (x *Record) GetOperation() Operation

func (*Record) GetPayload

func (x *Record) GetPayload() *Change

func (*Record) GetPosition

func (x *Record) GetPosition() []byte

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL