replication

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const (
	StandbyStatusUpdateByteID = 'r'
)

Variables

View Source
var (
	ErrorSlotInUse = errors.New("replication slot in use")
)

Functions

func AppendUint64

func AppendUint64(buf []byte, n uint64) []byte

func SendStandbyStatusUpdate

func SendStandbyStatusUpdate(_ context.Context, conn pq.Connection, walWritePosition uint64) error

Types

type ListenerContext

type ListenerContext struct {
	Message any
	Ack     func() error
}

type ListenerFunc

type ListenerFunc func(ctx *ListenerContext)

type Message

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

type Replication

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

func New

func New(conn pq.Connection) *Replication

func (*Replication) Start

func (r *Replication) Start(publicationName, slotName string) error

func (*Replication) Test

func (r *Replication) Test(ctx context.Context) error

type Streamer

type Streamer interface {
	Open(ctx context.Context) error
	Close(ctx context.Context)
	GetSystemInfo() *pq.IdentifySystemResult
	GetMetric() metric.Metric
}

func NewStream

func NewStream(conn pq.Connection, cfg config.Config, m metric.Metric, system *pq.IdentifySystemResult, listenerFunc ListenerFunc) Streamer

type XLogData

type XLogData struct {
	ServerTime   time.Time
	WALData      []byte
	WALStart     pq.LSN
	ServerWALEnd pq.LSN
}

func ParseXLogData

func ParseXLogData(buf []byte) (XLogData, error)

Jump to

Keyboard shortcuts

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