Documentation
¶
Index ¶
- func NewExporter(ctx context.Context, opts *connectors.Options, name string, ...) (exporter.Exporter, error)
- type Exporter
- func (p *Exporter) Close(ctx context.Context) error
- func (p *Exporter) Export(ctx context.Context, records <-chan *connectors.Record, ...) error
- func (p *Exporter) Flags() location.Flags
- func (p *Exporter) Origin() string
- func (p *Exporter) Ping(ctx context.Context) error
- func (p *Exporter) Root() string
- func (p *Exporter) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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).
Click to show internal directories.
Click to hide internal directories.