pbm

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClockSkew

func ClockSkew(rsName, ts, dockerHost string) error

Types

type Counter

type Counter struct {
	Count     int
	WallTime  time.Time
	ID        interface{}
	WriteTime primitive.Timestamp
}

func (Counter) String added in v1.3.2

func (c Counter) String() string

type Ctl

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

func NewCtl

func NewCtl(ctx context.Context, host string) (*Ctl, error)

func (*Ctl) ApplyConfig

func (c *Ctl) ApplyConfig(file string) error

func (*Ctl) Backup

func (c *Ctl) Backup(typ pbm.BackupType) (string, error)

func (*Ctl) CheckBackup

func (c *Ctl) CheckBackup(bcpName string, waitFor time.Duration) error

func (*Ctl) CheckOplogReplay added in v1.7.0

func (c *Ctl) CheckOplogReplay(a, b time.Time, timeout time.Duration) error

func (*Ctl) CheckPITRestore added in v1.3.2

func (c *Ctl) CheckPITRestore(t time.Time, timeout time.Duration) error

func (*Ctl) CheckRestore added in v1.1.2

func (c *Ctl) CheckRestore(bcpName string, waitFor time.Duration) error

func (*Ctl) ContainerLogs

func (c *Ctl) ContainerLogs() (string, error)

func (*Ctl) List added in v1.6.0

func (c *Ctl) List() (*ListOut, error)

func (*Ctl) PITRestore added in v1.3.2

func (c *Ctl) PITRestore(t time.Time) error

func (*Ctl) PITRestoreClusterTime added in v1.7.0

func (c *Ctl) PITRestoreClusterTime(t, i uint32) error

func (*Ctl) PITRoff added in v1.3.2

func (c *Ctl) PITRoff() error

func (*Ctl) PITRon added in v1.3.2

func (c *Ctl) PITRon() error

func (*Ctl) ReplayOplog added in v1.7.0

func (c *Ctl) ReplayOplog(a, b time.Time) error

func (*Ctl) Restore

func (c *Ctl) Restore(bcpName string) (string, error)

Restore starts restore and returns the name of op

func (*Ctl) Resync added in v1.7.0

func (c *Ctl) Resync() error

func (*Ctl) RunCmd

func (c *Ctl) RunCmd(cmds ...string) (string, error)

type Docker

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

func NewDocker

func NewDocker(ctx context.Context, host string) (*Docker, error)

func (*Docker) PauseAgents added in v1.5.0

func (d *Docker) PauseAgents(rsName string) error

PauseAgents pause agent containers of the given replicaset

func (*Docker) RestartAgents

func (d *Docker) RestartAgents(rsName string) error

RestartAgents restarts agent containers of the given replicaset

func (*Docker) RestartContainers added in v1.7.0

func (d *Docker) RestartContainers(labels []string) error

RestartAgents restarts agent containers of the given replicaset

func (*Docker) RunCmd

func (d *Docker) RunCmd(containerID string, wait time.Duration, cmd ...string) (string, error)

func (*Docker) RunOnReplSet

func (d *Docker) RunOnReplSet(rsName string, wait time.Duration, cmd ...string) error

func (*Docker) StartAgents

func (d *Docker) StartAgents(rsName string) error

StartAgents starts stopped agent containers of the given replicaset

func (*Docker) StartContainers added in v1.7.0

func (d *Docker) StartContainers(labels []string) error

StartAgents starts stopped agent containers of the given replicaset

func (*Docker) StopAgents

func (d *Docker) StopAgents(rsName string) error

StopAgents stops agent containers of the given replicaset

func (*Docker) StopContainers added in v1.7.0

func (d *Docker) StopContainers(labels []string) error

StopContainers stops containers with the given labels

func (*Docker) UnpauseAgents added in v1.5.0

func (d *Docker) UnpauseAgents(rsName string) error

UnpauseAgents unpause agent containers of the given replicaset

type ListOut added in v1.6.0

type ListOut struct {
	Snapshots []SnapshotStat `json:"snapshots"`
	PITR      struct {
		On       bool                   `json:"on"`
		Ranges   []PitrRange            `json:"ranges"`
		RsRanges map[string][]PitrRange `json:"rsRanges,omitempty"`
	} `json:"pitr"`
}

type Mongo

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

func NewMongo

func NewMongo(ctx context.Context, connectionURI string) (*Mongo, error)

func (*Mongo) Conn

func (m *Mongo) Conn() *mongo.Client

func (*Mongo) Count added in v1.6.0

func (m *Mongo) Count(col string) (int64, error)

func (*Mongo) CreateTS added in v1.6.0

func (m *Mongo) CreateTS(name string) error

func (*Mongo) DBhashes

func (m *Mongo) DBhashes() (map[string]string, error)

func (*Mongo) Drop added in v1.6.0

func (m *Mongo) Drop(col string) error

func (*Mongo) GenBallast

func (m *Mongo) GenBallast(ln int64) error

func (*Mongo) GenData

func (m *Mongo) GenData(db, collection string, start, ln int64) error

func (*Mongo) GetCounters

func (m *Mongo) GetCounters() ([]Counter, error)

func (*Mongo) GetLastWrite

func (m *Mongo) GetLastWrite() (primitive.Timestamp, error)

func (*Mongo) GetNodeInfo added in v1.3.0

func (m *Mongo) GetNodeInfo() (*pbm.NodeInfo, error)

func (*Mongo) InsertTS added in v1.6.0

func (m *Mongo) InsertTS(col string) error

func (*Mongo) ResetBallast

func (m *Mongo) ResetBallast() (int, error)

func (*Mongo) ResetCounters

func (m *Mongo) ResetCounters() (int, error)

func (*Mongo) ServerVersion

func (m *Mongo) ServerVersion() (string, error)

func (*Mongo) SetBallast added in v1.5.0

func (m *Mongo) SetBallast(size int64) (int64, error)

SetBallast sets ballast documents amount to be equal to given `size` it removes execive documents or creates new if needed

func (*Mongo) WriteCounter

func (m *Mongo) WriteCounter(i int) (*Counter, error)

type MongoPBM

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

func NewMongoPBM

func NewMongoPBM(ctx context.Context, connectionURI string) (*MongoPBM, error)

func (*MongoPBM) BackupsList added in v1.2.0

func (m *MongoPBM) BackupsList(limit int64) ([]pbm.BackupMeta, error)

func (*MongoPBM) Conn added in v1.2.0

func (m *MongoPBM) Conn() *mongo.Client

func (*MongoPBM) DeleteBackup added in v1.6.0

func (m *MongoPBM) DeleteBackup(bcpName string) error

func (*MongoPBM) GetBackupMeta

func (m *MongoPBM) GetBackupMeta(bcpName string) (*pbm.BackupMeta, error)

func (*MongoPBM) SendCmd added in v1.5.0

func (m *MongoPBM) SendCmd(cmd pbm.Cmd) error

func (*MongoPBM) Storage added in v1.6.0

func (m *MongoPBM) Storage() (storage.Storage, error)

func (*MongoPBM) StoreResync added in v1.1.2

func (m *MongoPBM) StoreResync() error

func (*MongoPBM) WaitConcurentOp added in v1.4.0

func (m *MongoPBM) WaitConcurentOp(lock *pbm.LockHeader, waitFor time.Duration) error

WaitConcurentOp waits up to waitFor duration until operations which acquires a given lock are finished

func (*MongoPBM) WaitOp added in v1.1.2

func (m *MongoPBM) WaitOp(lock *pbm.LockHeader, waitFor time.Duration) error

WaitOp waits up to waitFor duration until operations which acquires a given lock are finished

type PitrRange added in v1.6.0

type PitrRange struct {
	Err   string       `json:"error,omitempty"`
	Range pbm.Timeline `json:"range"`
}

type SnapshotStat added in v1.6.0

type SnapshotStat struct {
	Name       string     `json:"name"`
	Size       int64      `json:"size,omitempty"`
	Status     pbm.Status `json:"status"`
	Err        string     `json:"error,omitempty"`
	StateTS    int64      `json:"completeTS"`
	PBMVersion string     `json:"pbmVersion"`
}

type TestData

type TestData struct {
	IDX   int64   `bson:"idx"`
	Num   []int64 `bson:"num"`
	Data1 []byte  `bson:"data1"`
	Data2 []byte  `bson:"data2"`
	C     int     `bson:"changed"`
}

Jump to

Keyboard shortcuts

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