message

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

	TupleNull      TupleKind = 'n' // Identifies the data as NULL value.
	TupleUnchanged TupleKind = 'u' // Identifies unchanged TOASTed value (the actual value is not sent).
	TupleText      TupleKind = '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 {
	FinalLSN  dbtypes.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 dbtypes.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 {
	Flags          uint8       // Flags; currently unused (must be 0)
	LSN            dbtypes.LSN // The LastLSN of the commit.
	TransactionLSN dbtypes.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 {
	RelationOID dbtypes.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 {
	RelationOID dbtypes.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 {
	LSN  dbtypes.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"`

	OID             dbtypes.OID     `yaml:"OID"`             // OID of the relation.
	ReplicaIdentity ReplicaIdentity `yaml:"ReplicaIdentity"` // Replica identity
	Columns         []Column        `yaml:"Columns"`         // Columns
}

func (*Relation) Equal

func (r *Relation) Equal(rel2 *Relation) bool

func (Relation) String

func (r 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 // set of columns

func (Row) Bytes

func (r Row) Bytes() []byte

type Truncate

type Truncate struct {
	Cascade         bool
	RestartIdentity bool
	RelationOIDs    []dbtypes.OID
}

func (Truncate) String

func (m Truncate) String() string

type Tuple

type Tuple struct {
	Kind  TupleKind
	Value []byte
}

func (Tuple) Bytes

func (t Tuple) Bytes() []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

	OID dbtypes.OID // OID of the data type
}

func (Type) String

func (m Type) String() string

type Update

type Update struct {
	RelationOID dbtypes.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