mongo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mongo is the MongoDB driver: mongodump --archive | mongorestore --archive, both run inside the local mongo container towards any pair of endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

func New

func New() *Driver

func (*Driver) Address added in v0.2.0

func (*Driver) Address(ep driver.Endpoint) string

Address is the host list of the URI, credentials and options left out.

func (*Driver) Configured

func (*Driver) Configured(ep driver.Endpoint) bool

func (*Driver) Databases added in v0.2.0

func (*Driver) Databases(ctx context.Context, ep driver.Endpoint) ([]string, error)

func (*Driver) Fields

func (*Driver) Fields() []driver.Field

func (*Driver) Local added in v0.1.1

func (*Driver) Local() driver.Local

func (*Driver) Name

func (*Driver) Name() string

func (*Driver) Objects

func (*Driver) Objects(ctx context.Context, ep driver.Endpoint, db string) ([]driver.Object, error)

func (*Driver) Permanent added in v0.2.0

func (*Driver) Permanent(line string) bool

Permanent matches errors no retry can fix: authentication and authorization failures.

func (*Driver) Plan

func (d *Driver) Plan(ctx context.Context, src, dst driver.Endpoint, db string, workers int, only []string) (driver.Plan, error)

Plan gives every collection of at least splitSize its own stream and bundles the rest (small collections and views) into one more, which excludes everything that is either streamed on its own or not selected. If the collections cannot be listed, the whole database goes as a single stream.

func (*Driver) Prepare

func (*Driver) Prepare(ctx context.Context, dst driver.Endpoint, db string, fresh bool) error

Prepare only acts with fresh: mongorestore creates the database on first insert.

func (*Driver) StageFromLog

func (*Driver) StageFromLog(line string) string

func (*Driver) StageFromStream

func (*Driver) StageFromStream([]byte) string

Jump to

Keyboard shortcuts

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