message

package
v0.0.0-...-e8a41ca Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReplicaIdentityDefault ReplicaIdentity = 'd'
	ReplicaIdentityNothing                 = 'n'
	ReplicaIdentityIndex                   = 'i'
	ReplicaIdentityFull                    = 'f'

	TupleNull      TupleKind = 'n' // Identifies the data as NULL value.
	TupleUnchanged           = 'u' // Identifies unchanged TOASTed value (the actual value is not sent).
	TupleText                = 't' // Identifies the data as text formatted value.

	MsgInsert MType = iota
	MsgUpdate
	MsgDelete
	MsgBegin
	MsgCommit
	MsgRelation
	MsgType
	MsgOrigin
	MsgTruncate
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Begin

type Begin struct {
	Raw       []byte
	FinalLSN  utils.LSN // LSN of the record that lead to this xact to be committed
	Timestamp time.Time // Commit timestamp of the transaction
	XID       int32     // Xid of the transaction.
}

func (Begin) String

func (m Begin) String() string

type Column

type Column struct {
	IsKey   bool      `yaml:"IsKey"` // column as part of the key.
	Name    string    `yaml:"Name"`  // Name of the column.
	TypeOID utils.OID `yaml:"OID"`   // OID of the column's data type.
	Mode    int32     `yaml:"Mode"`  // OID modifier of the column (atttypmod).
}

type Commit

type Commit struct {
	Raw            []byte
	Flags          uint8     // Flags; currently unused (must be 0)
	LSN            utils.LSN // The LastLSN of the commit.
	TransactionLSN utils.LSN // LSN pointing to the end of the commit record + 1
	Timestamp      time.Time // Commit timestamp of the transaction
}

func (Commit) String

func (m Commit) String() string

type Delete

type Delete struct {
	Raw         []byte
	RelationOID utils.OID // OID of the relation corresponding to the OID in the relation message.
	IsKey       bool      // OldRow contains columns which are part of REPLICA IDENTITY index.
	IsOld       bool      // OldRow contains old tuple in case of REPLICA IDENTITY set to FULL

	OldRow Row
}

func (Delete) String

func (m Delete) String() string

type Insert

type Insert struct {
	Raw         []byte
	RelationOID utils.OID // OID of the relation corresponding to the OID in the relation message.
	IsNew       bool      // Identifies tuple as a new tuple.

	NewRow Row
}

func (Insert) String

func (m Insert) String() string

type MType

type MType int

func (MType) String

func (t MType) String() string

type Message

type Message interface {
	fmt.Stringer
}

type NamespacedName

type NamespacedName struct {
	Namespace string `yaml:"Namespace"`
	Name      string `yaml:"Name"`
}

func (NamespacedName) Sanitize

func (n NamespacedName) Sanitize() string

func (NamespacedName) String

func (n NamespacedName) String() string

type Origin

type Origin struct {
	Raw  []byte
	LSN  utils.LSN // The last LSN of the commit on the origin server.
	Name string
}

func (Origin) String

func (m Origin) String() string

type Relation

type Relation struct {
	NamespacedName `yaml:"NamespacedName"`

	Raw             []byte          `yaml:"-"`
	OID             utils.OID       `yaml:"OID"`             // OID of the relation.
	ReplicaIdentity ReplicaIdentity `yaml:"ReplicaIdentity"` // Replica identity
	Columns         []Column        `yaml:"Columns"`         // Columns
}

func (Relation) String

func (m Relation) String() string

type ReplicaIdentity

type ReplicaIdentity uint8

func (*ReplicaIdentity) DecodeText

func (r *ReplicaIdentity) DecodeText(ci *pgtype.ConnInfo, src []byte) error

func (ReplicaIdentity) MarshalYAML

func (r ReplicaIdentity) MarshalYAML() (interface{}, error)

func (ReplicaIdentity) String

func (r ReplicaIdentity) String() string

func (*ReplicaIdentity) UnmarshalYAML

func (r *ReplicaIdentity) UnmarshalYAML(unmarshal func(interface{}) error) error

type Row

type Row []Tuple

type Truncate

type Truncate struct {
	Raw             []byte
	Cascade         bool
	RestartIdentity bool
	RelationOIDs    []utils.OID
}

func (Truncate) String

func (m Truncate) String() string

type Tuple

type Tuple struct {
	Kind  TupleKind
	Value []byte
}

func (Tuple) String

func (t Tuple) String() string

type TupleKind

type TupleKind uint8

func (TupleKind) String

func (t TupleKind) String() string

type Type

type Type struct {
	NamespacedName

	Raw []byte
	OID utils.OID // OID of the data type
}

func (Type) String

func (m Type) String() string

type Update

type Update struct {
	Raw         []byte
	RelationOID utils.OID // OID of the relation corresponding to the OID in the relation message.
	IsKey       bool      // OldRow contains columns which are part of REPLICA IDENTITY index.
	IsOld       bool      // OldRow contains old tuple in case of REPLICA IDENTITY set to FULL
	IsNew       bool      // Identifies tuple as a new tuple.

	OldRow Row
	NewRow Row
}

func (Update) String

func (m Update) String() string

Jump to

Keyboard shortcuts

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