adaptor

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: BSD-3-Clause Imports: 15 Imported by: 0

README

PostgreSQL adaptor

The PostgreSQL adaptor is capable of reading/tailing tables using logical decoding and receiving data for inserts.

Configuration:
- pg:
    type: postgres
    uri: postgres://127.0.0.1:5432/test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI             string `json:"uri" doc:"the uri to connect to, in the form 'user=my-user password=my-password dbname=dbname sslmode=require'"`
	Namespace       string `json:"namespace" doc:"mongo namespace to read/write"`
	Timeout         string `json:"timeout" doc:"timeout for establishing connection, format must be parsable by time.ParseDuration and defaults to 10s"`
	Debug           bool   `json:"debug" doc:"display debug information"`
	Tail            bool   `json:"tail" doc:"if tail is true, then the postgres source will tail the oplog after copying the namespace"`
	ReplicationSlot string `json:"replication_slot" doc:"required if tail is true; sets the replication slot to use for logical decoding"`
	Wc              int    `` /* 143-byte string literal not displayed */
	FSync           bool   `json:"fsync" doc:"When writing, should we flush to disk before returning success"`
	Bulk            bool   `json:"bulk" doc:"use a buffer to bulk insert documents"`
}

Config provides configuration options for a postgres adaptor the notable difference between this and dbConfig is the presence of the Tail option

type Postgres

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

Postgres is an adaptor to read / write to postgres. it works as a source by copying files, and then optionally tailing the oplog

func (*Postgres) Connect

func (p *Postgres) Connect() error

func (*Postgres) Description

func (p *Postgres) Description() string

Description for postgres adaptor

func (*Postgres) Listen

func (p *Postgres) Listen() (err error)

Listen starts the pipe's listener

func (*Postgres) SampleConfig

func (p *Postgres) SampleConfig() string

SampleConfig for postgres adaptor

func (*Postgres) Start

func (p *Postgres) Start() (err error)

Start the adaptor as a source

func (*Postgres) Stop

func (p *Postgres) Stop() error

Stop the adaptor

Jump to

Keyboard shortcuts

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