Help us shape the future of Go! Take the 2026 Go Developer Survey

exporter

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExporter

func NewExporter(ctx context.Context, opts *connectors.Options, name string, config map[string]string) (exporter.Exporter, error)

Types

type Exporter

type Exporter struct {
	TokenProvider func(context.Context) (string, error) // optional; refreshes conn.Password before each subprocess
	// contains filtered or unexported fields
}

func NewExporterFromConfigMap

func NewExporterFromConfigMap(conn pgconn.ConnConfig, dbPath, connType string, config map[string]string) (*Exporter, error)

NewExporterFromConfigMap creates an Exporter from an already-constructed ConnConfig (e.g. one whose password was replaced with a fetched token) and the raw config map for the remaining option parsing. connType is the value returned by Type().

func (*Exporter) Close

func (p *Exporter) Close(ctx context.Context) error

func (*Exporter) Export

func (p *Exporter) Export(ctx context.Context, records <-chan *connectors.Record, results chan<- *connectors.Result) error

Export restores each record to the configured PostgreSQL server. Records ending in ".dump" are restored via pg_restore (pg_dump custom format). Records ending in ".sql" are fed to psql (pg_dumpall plain-SQL format).

func (*Exporter) Flags

func (p *Exporter) Flags() location.Flags

func (*Exporter) Origin

func (p *Exporter) Origin() string

func (*Exporter) Ping

func (p *Exporter) Ping(ctx context.Context) error

func (*Exporter) Root

func (p *Exporter) Root() string

func (*Exporter) Type

func (p *Exporter) Type() string

Jump to

Keyboard shortcuts

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