postgres

package
v0.0.0-...-cd81764 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSlot

func CreateSlot(ctx context.Context, conn *pgconn.PgConn, slotName string) error

func DropSlot

func DropSlot(ctx context.Context, conn *pgconn.PgConn, slotName string) error

Types

type HandleFunc

type HandleFunc func(data WalData) error

type WalData

type WalData struct {
	StreamName string
	StreamID   string
	EventName  string
	Version    int64
	Data       []byte
}

func (WalData) Validate

func (d WalData) Validate() error

type WalReceiver

type WalReceiver struct {
	// contains filtered or unexported fields
}

func NewWalReceiverWithContext

func NewWalReceiverWithContext(
	ctx context.Context,
	conn *pgconn.PgConn,
	slotName string,
) *WalReceiver

func (*WalReceiver) Listen

func (r *WalReceiver) Listen() error

func (*WalReceiver) OnError

func (r *WalReceiver) OnError(fn func(*pgproto3.ErrorResponse))

func (*WalReceiver) OnExit

func (r *WalReceiver) OnExit(fn func())

func (*WalReceiver) OnMessage

func (r *WalReceiver) OnMessage(fn HandleFunc)

func (*WalReceiver) OnPrimaryKeepalive

func (r *WalReceiver) OnPrimaryKeepalive(fn func(pglogrepl.PrimaryKeepaliveMessage))

func (*WalReceiver) OnStandbyStatusUpdate

func (r *WalReceiver) OnStandbyStatusUpdate(fn func(pglogrepl.LSN))

Jump to

Keyboard shortcuts

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