Documentation ¶
Index ¶
- Constants
- Variables
- func CanDeleteBackup(ctx context.Context, client *Client, bcp *BackupMetadata) error
- func CanDeleteIncrementalBackup(ctx context.Context, client *Client, bcp *BackupMetadata, ...) error
- func IsHeartbeatStale(clusterTime, other Timestamp) bool
- func WaitForCleanup(ctx context.Context, client *Client) error
- func WaitForDeleteBackup(ctx context.Context, client *Client) error
- func WaitForDeleteOplogRange(ctx context.Context, client *Client) error
- func WaitForErrorLog(ctx context.Context, client *Client, cmd *Command) (string, error)
- func WaitForResync(ctx context.Context, c *Client, cid CommandID) error
- type AgentStatus
- type BackupMetadata
- type BackupType
- type CleanupReport
- type Client
- func (c *Client) CancelBackup(ctx context.Context) (CommandID, error)
- func (c *Client) CleanupReport(ctx context.Context, beforeTS Timestamp) (CleanupReport, error)
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) CommandInfo(ctx context.Context, id CommandID) (*Command, error)
- func (c *Client) DeleteBackupBefore(ctx context.Context, beforeTS Timestamp, options DeleteBackupBeforeOptions) (CommandID, error)
- func (c *Client) DeleteBackupByName(ctx context.Context, name string) (CommandID, error)
- func (c *Client) DeleteOplogRange(ctx context.Context, until Timestamp) (CommandID, error)
- func (c *Client) GetAllBackups(ctx context.Context) ([]BackupMetadata, error)
- func (c *Client) GetAllRestores(ctx context.Context, m connect.Client, options GetAllRestoresOptions) ([]RestoreMetadata, error)
- func (c *Client) GetBackupByName(ctx context.Context, name string, options GetBackupByNameOptions) (*BackupMetadata, error)
- func (c *Client) GetBackupByOpID(ctx context.Context, opid string, options GetBackupByNameOptions) (*BackupMetadata, error)
- func (c *Client) GetConfig(ctx context.Context) (*Config, error)
- func (c *Client) GetRestoreByName(ctx context.Context, name string) (*RestoreMetadata, error)
- func (c *Client) GetRestoreByOpID(ctx context.Context, opid string) (*RestoreMetadata, error)
- func (c *Client) OpLocks(ctx context.Context) ([]OpLock, error)
- func (c *Client) Restore(ctx context.Context, backupName string, clusterTS Timestamp) (CommandID, error)
- func (c *Client) RunCleanup(ctx context.Context, beforeTS Timestamp) (CommandID, error)
- func (c *Client) RunIncrementalBackup(ctx context.Context, options IncrementalBackupOptions) (CommandID, error)
- func (c *Client) RunLogicalBackup(ctx context.Context, options LogicalBackupOptions) (CommandID, error)
- func (c *Client) RunPhysicalBackup(ctx context.Context, options PhysicalBackupOptions) (CommandID, error)
- func (c *Client) SetConfig(ctx context.Context, cfg Config) (CommandID, error)
- func (c *Client) SyncFromStorage(ctx context.Context) (CommandID, error)
- type Command
- type CommandID
- type CommandType
- type CompressionLevel
- type CompressionType
- type Config
- type DeleteBackupBeforeOptions
- type GetAllRestoresOptions
- type GetBackupByNameOptions
- type IncrementalBackupOptions
- type LogicalBackupOptions
- type OpLock
- type OplogChunk
- type PhysicalBackupOptions
- type ReplsetInfo
- type RestoreMetadata
- type Timestamp
Constants ¶
View Source
const ( CmdBackup = ctrl.CmdBackup CmdRestore = ctrl.CmdRestore CmdReplay = ctrl.CmdReplay CmdCancelBackup = ctrl.CmdCancelBackup CmdResync = ctrl.CmdResync CmdPITR = ctrl.CmdPITR CmdDeleteBackup = ctrl.CmdDeleteBackup CmdDeletePITR = ctrl.CmdDeletePITR CmdCleanup = ctrl.CmdCleanup )
View Source
const ( LogicalBackup = defs.LogicalBackup PhysicalBackup = defs.PhysicalBackup IncrementalBackup = defs.IncrementalBackup ExternalBackup = defs.ExternalBackup SelectiveBackup = backup.SelectiveBackup )
View Source
const ( CompressionTypeNone = compress.CompressionTypeNone CompressionTypeGZIP = compress.CompressionTypeGZIP CompressionTypePGZIP = compress.CompressionTypePGZIP CompressionTypeSNAPPY = compress.CompressionTypeSNAPPY CompressionTypeLZ4 = compress.CompressionTypeLZ4 CompressionTypeS2 = compress.CompressionTypeS2 CompressionTypeZstandard = compress.CompressionTypeZstandard )
Variables ¶
View Source
var ( ErrBackupInProgress = backup.ErrBackupInProgress ErrIncrementalBackup = backup.ErrIncrementalBackup ErrNonIncrementalBackup = backup.ErrNonIncrementalBackup ErrNotBaseIncrement = backup.ErrNotBaseIncrement ErrBaseForPITR = backup.ErrBaseForPITR )
View Source
var ( ErrUnsupported = errors.New("unsupported") ErrInvalidCommandID = errors.New("invalid command id") ErrNotFound = errors.New("not found") )
View Source
var ( ErrMissedClusterTime = errors.New("missed cluster time") ErrInvalidDeleteBackupType = backup.ErrInvalidDeleteBackupType )
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrStaleHearbeat = errors.New("stale heartbeat")
View Source
var NoOpID = CommandID(ctrl.NilOPID.String())
Functions ¶
func CanDeleteBackup ¶
func CanDeleteBackup(ctx context.Context, client *Client, bcp *BackupMetadata) error
func CanDeleteIncrementalBackup ¶
func CanDeleteIncrementalBackup( ctx context.Context, client *Client, bcp *BackupMetadata, increments [][]*BackupMetadata, ) error
func IsHeartbeatStale ¶
func WaitForDeleteOplogRange ¶
func WaitForErrorLog ¶
Types ¶
type AgentStatus ¶
func AgentStatuses ¶
func AgentStatuses(ctx context.Context, client *Client) ([]AgentStatus, error)
AgentStatuses returns list of all PBM Agents statuses.
type BackupMetadata ¶
type BackupMetadata = backup.BackupMeta
func ListDeleteBackupBefore ¶
func ListDeleteBackupBefore( ctx context.Context, client *Client, ts primitive.Timestamp, bcpType BackupType, ) ([]BackupMetadata, error)
type BackupType ¶
type BackupType = defs.BackupType
func ParseDeleteBackupType ¶
func ParseDeleteBackupType(s string) (BackupType, error)
type CleanupReport ¶
type CleanupReport = backup.CleanupInfo
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CleanupReport ¶
func (*Client) CommandInfo ¶
func (*Client) DeleteBackupBefore ¶
func (*Client) DeleteBackupByName ¶
func (*Client) DeleteOplogRange ¶
func (*Client) GetAllBackups ¶
func (c *Client) GetAllBackups(ctx context.Context) ([]BackupMetadata, error)
func (*Client) GetAllRestores ¶
func (c *Client) GetAllRestores( ctx context.Context, m connect.Client, options GetAllRestoresOptions, ) ([]RestoreMetadata, error)
func (*Client) GetBackupByName ¶
func (c *Client) GetBackupByName( ctx context.Context, name string, options GetBackupByNameOptions, ) (*BackupMetadata, error)
func (*Client) GetBackupByOpID ¶
func (c *Client) GetBackupByOpID( ctx context.Context, opid string, options GetBackupByNameOptions, ) (*BackupMetadata, error)
func (*Client) GetRestoreByName ¶
func (*Client) GetRestoreByOpID ¶
func (*Client) RunCleanup ¶
func (*Client) RunIncrementalBackup ¶
func (*Client) RunLogicalBackup ¶
func (*Client) RunPhysicalBackup ¶
type CommandType ¶
type CompressionLevel ¶
type CompressionLevel *int
type CompressionType ¶
type CompressionType = compress.CompressionType
type DeleteBackupBeforeOptions ¶
type DeleteBackupBeforeOptions struct {
Type BackupType
}
type GetAllRestoresOptions ¶
type GetAllRestoresOptions struct {
Limit int64
}
type GetBackupByNameOptions ¶
type IncrementalBackupOptions ¶
type IncrementalBackupOptions struct { NewBase bool CompressionType CompressionType CompressionLevel CompressionLevel }
type LogicalBackupOptions ¶
type LogicalBackupOptions struct { CompressionType CompressionType CompressionLevel CompressionLevel Namespaces []string }
type OpLock ¶
type OpLock struct { // OpID is its command id. OpID CommandID `json:"opid,omitempty"` // Cmd is the type of command Cmd CommandType `json:"cmd,omitempty"` // Replset is name of a replset that acquired the lock. Replset string `json:"rs,omitempty"` // Node is `host:port` pair of an agent that acquired the lock. Node string `json:"node,omitempty"` // Heartbeat is the last cluster time seen by an agent that acquired the lock. Heartbeat primitive.Timestamp `json:"hb"` // contains filtered or unexported fields }
OpLock represents internal PBM lock.
Some commands can have many locks (one lock per replset).
type PhysicalBackupOptions ¶
type PhysicalBackupOptions struct { CompressionType CompressionType CompressionLevel CompressionLevel }
type ReplsetInfo ¶
func ClusterMembers ¶
func ClusterMembers(ctx context.Context, client *Client) ([]ReplsetInfo, error)
ClusterMembers returns list of replsets in the cluster.
For sharded cluster: the configsvr (with ID `config`) and all shards. For non-sharded cluster: the replset.
type RestoreMetadata ¶
type RestoreMetadata = restore.RestoreMeta
Click to show internal directories.
Click to hide internal directories.