pbm

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 23 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

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() (string, error)

func (*Ctl) CheckBackup

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

func (*Ctl) CheckPITRestore

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

func (*Ctl) CheckRestore

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

func (*Ctl) ContainerLogs

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

func (*Ctl) PITRestore

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

func (*Ctl) PITRoff

func (c *Ctl) PITRoff() error

func (*Ctl) PITRon

func (c *Ctl) PITRon() error

func (*Ctl) Restore

func (c *Ctl) Restore(bcpName string) 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) RestartAgents

func (d *Docker) RestartAgents(rsName 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) StopAgents

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

StopAgents stops agent containers of the given replicaset

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) DBhashes

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

func (*Mongo) GenBallast

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

func (*Mongo) GenData

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

func (*Mongo) GetCounters

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

func (*Mongo) GetLastWrite

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

func (*Mongo) GetNodeInfo

func (m *Mongo) GetNodeInfo() (*pbm.NodeInfo, 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) 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

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

func (*MongoPBM) Conn

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

func (*MongoPBM) GetBackupMeta

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

func (*MongoPBM) StoreResync

func (m *MongoPBM) StoreResync() error

func (*MongoPBM) WaitConcurentOp

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

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 TestData

type TestData struct {
	IDX   int     `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