gcp

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeStreamRecord

type ChangeStreamRecord struct {
	DataChangeRecord      []*DataChangeRecord      `spanner:"data_change_record" json:",omitempty"`
	HeartbeatRecord       []*HeartbeatRecord       `spanner:"heartbeat_record" json:",omitempty"`
	ChildPartitionsRecord []*ChildPartitionsRecord `spanner:"child_partitions_record" json:",omitempty"`
}

type ChildPartitionsRecord

type ChildPartitionsRecord struct {
	RecordSequence  string    `spanner:"record_sequence"`
	StartTimestamp  TimeMills `spanner:"start_timestamp"`
	ChildPartitions []*struct {
		Token                 string   `spanner:"token"`
		ParentPartitionTokens []string `spanner:"parent_partition_tokens"`
	} `spanner:"child_partitions"`
}

type DataChangeRecord

type DataChangeRecord struct {
	Metadata *struct {
		ChangeStreamRecordMetadata *struct {
			NumberOfRecordsRead     int64      `json:"number_of_records_read"`
			PartitionCreatedAt      TimeMills  `json:"partition_created_at"`
			PartitionEndTimestamp   TimeMills  `json:"partition_end_timestamp"`
			PartitionRunningAt      *TimeMills `json:"partition_running_at"`
			PartitionScheduledAt    *TimeMills `json:"partition_scheduled_at"`
			PartitionStartTimestamp TimeMills  `json:"partition_start_timestamp"`
			PartitionToken          string     `json:"partition_token"`
			QueryStartedAt          TimeMills  `json:"query_started_at"`
			RecordReadAt            TimeMills  `json:"record_read_at"`
			RecordStreamEndedAt     TimeMills  `json:"record_stream_ended_at"`
			RecordStreamStartedAt   TimeMills  `json:"record_stream_started_at"`
			RecordTimestamp         TimeMills  `json:"record_timestamp"`
			TotalStreamTimeMillis   int64      `json:"total_stream_time_millis"`
		} `json:"com.google.cloud.teleport.v2.ChangeStreamRecordMetadata,omitempty"`
	} `spanner:"_" json:"metadata,omitempty"`
	CommitTimestamp                      TimeMills `spanner:"commit_timestamp" json:"commit_timestamp"`
	RecordSequence                       string    `spanner:"record_sequence" json:"record_sequence"`
	ServerTransactionId                  string    `spanner:"server_transaction_id" json:"server_transaction_id"`
	IsLastRecordInTransactionInPartition bool      `spanner:"is_last_record_in_transaction_in_partition" json:"is_last_record_in_transaction_in_partition"`
	TableName                            string    `spanner:"table_name" json:"table_name"`
	ValueCaptureType                     string    `spanner:"value_capture_type" json:"value_capture_type"`
	ColumnTypes                          []*struct {
		Name            string           `spanner:"name" json:"name"`
		Type            spanner.NullJSON `spanner:"type" json:"type"`
		IsPrimaryKey    bool             `spanner:"is_primary_key" json:"is_primary_key"`
		OrdinalPosition int64            `spanner:"ordinal_position" json:"ordinal_position"`
	} `spanner:"column_types" json:"column_types"`
	Mods                            []*Mod `spanner:"mods" json:"mods"`
	ModType                         string `spanner:"mod_type" json:"mod_type"`
	NumberOfRecordsInTransaction    int64  `spanner:"number_of_records_in_transaction" json:"number_of_records_in_transaction"`
	NumberOfPartitionsInTransaction int64  `spanner:"number_of_partitions_in_transaction" json:"number_of_partitions_in_transaction"`
	TransactionTag                  string `spanner:"transaction_tag" json:"transaction_tag"`
	IsSystemTransaction             bool   `spanner:"is_system_transaction" json:"is_system_transaction"`
}

DataChangeRecord is compatible with spanner.Row and avroio.

type HeartbeatRecord

type HeartbeatRecord struct {
	Timestamp TimeMills `spanner:"timestamp"`
}

type Mod

type Mod struct {
	Keys      spanner.NullJSON `spanner:"keys" json:"keys"`
	NewValues spanner.NullJSON `spanner:"new_values" json:"new_values"`
	OldValues spanner.NullJSON `spanner:"old_values" json:"old_values"`
}

func (*Mod) ToMap

func (m *Mod) ToMap() (map[string]any, error)

type TimeMills

type TimeMills time.Time

TimeMills fall back to UnixMicro() if it is not compatible with (*time.Time).Unmarshal()

func (TimeMills) MarshalJSON

func (t TimeMills) MarshalJSON() ([]byte, error)

func (*TimeMills) UnmarshalJSON

func (t *TimeMills) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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