Documentation
¶
Index ¶
- func NewImporter(appCtx context.Context, opts *connectors.Options, name string, ...) (importer.Importer, error)
- type Importer
- func (p *Importer) Close(ctx context.Context) error
- func (p *Importer) Flags() location.Flags
- func (p *Importer) Import(ctx context.Context, records chan<- *connectors.Record, ...) error
- func (p *Importer) Origin() string
- func (p *Importer) Ping(ctx context.Context) error
- func (p *Importer) Root() string
- func (p *Importer) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Importer ¶
type Importer struct {
TokenProvider func(context.Context) (string, error) // optional; refreshes conn.Password before each subprocess
// contains filtered or unexported fields
}
func NewImporterFromConfigMap ¶
func NewImporterFromConfigMap(conn pgconn.ConnConfig, dbPath, connType string, config map[string]string) (*Importer, error)
NewImporterFromConfigMap creates an Importer 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(); pass an empty string to use the default "postgresql".
func (*Importer) Flags ¶
Flags returns FLAG_STREAM to signal that Import produces a single streaming pass. Without it, the framework calls Import twice — once to enumerate records and once to read their contents — which would cause the manifest and the dump to be emitted twice.
func (*Importer) Import ¶
func (p *Importer) Import(ctx context.Context, records chan<- *connectors.Record, results <-chan *connectors.Result) error
Click to show internal directories.
Click to hide internal directories.