parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wal2JsonChange

type Wal2JsonChange struct {
	// Operation kind (e.g. insert, update, delete)
	Kind string `json:"kind"`

	// Schema & Table names
	Schema string `json:"schema"`
	Table  string `json:"table"`

	// Column names
	ColumnNames []string `json:"columnnames"`

	// Human-readable column types
	ColumnTypes []string `json:"columntypes"`

	// Column types in Postgres OID format
	ColumnTypeOIDs []float64 `json:"columntypeoids"`

	// Current column values (after the operation)
	ColumnValues []interface{} `json:"columnvalues"`

	// Present on UPDATE operations, contains affected
	// keys and, if table replica identity is set to FULL,
	// previous values
	OldKeys struct {
		KeyNames []string `json:"keynames"`

		KeyTypes    []string  `json:"keytypes"`
		KeyTypeOIDs []float64 `json:"keytypeoids"`

		KeyValues []interface{} `json:"keyvalues"`
	} `json:"oldkeys"`
}

type Wal2JsonMessage

type Wal2JsonMessage struct {
	NextLSN   string           `json:"nextlsn"`
	Timestamp string           `json:"timestamp"`
	Change    []Wal2JsonChange `json:"change"`
}

func ParseWal2JsonPayload

func ParseWal2JsonPayload(payload []byte) (*Wal2JsonMessage, error)

Parses wal2json payload (as included in pgx.WalMessage as WalData) to Wal2JsonMessage struct

Jump to

Keyboard shortcuts

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