ctrl

package
v1.8.1-0...-d06cab7 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ListenCmd

func ListenCmd(ctx context.Context, m connect.Client, cl <-chan struct{}) (<-chan Cmd, <-chan error)

Types

type BackupCmd

type BackupCmd struct {
	Type             defs.BackupType          `bson:"type"`
	IncrBase         bool                     `bson:"base"`
	Name             string                   `bson:"name"`
	Namespaces       []string                 `bson:"nss,omitempty"`
	Compression      compress.CompressionType `bson:"compression"`
	CompressionLevel *int                     `bson:"level,omitempty"`
	NumParallelColls *int32                   `bson:"numParallelColls,omitempty"`
	Filelist         bool                     `bson:"filelist,omitempty"`
	Profile          string                   `bson:"profile,omitempty"`
}

func (BackupCmd) String

func (b BackupCmd) String() string

type CleanupCmd

type CleanupCmd struct {
	OlderThan primitive.Timestamp `bson:"olderThan"`
}

type Cmd

type Cmd struct {
	Cmd        Command          `bson:"cmd"`
	Resync     *ResyncCmd       `bson:"resync,omitempty"`
	Profile    *ProfileCmd      `bson:"profile,omitempty"`
	Backup     *BackupCmd       `bson:"backup,omitempty"`
	Restore    *RestoreCmd      `bson:"restore,omitempty"`
	Replay     *ReplayCmd       `bson:"replay,omitempty"`
	Delete     *DeleteBackupCmd `bson:"delete,omitempty"`
	DeletePITR *DeletePITRCmd   `bson:"deletePitr,omitempty"`
	Cleanup    *CleanupCmd      `bson:"cleanup,omitempty"`
	TS         int64            `bson:"ts"`
	OPID       OPID             `bson:"-"`
}

func (Cmd) String

func (c Cmd) String() string

type Command

type Command string

Command represents actions that could be done on behalf of the client by the agents

const (
	CmdUndefined           Command = ""
	CmdAddConfigProfile    Command = "addConfigProfile"
	CmdRemoveConfigProfile Command = "removeConfigProfile"
	CmdBackup              Command = "backup"
	CmdRestore             Command = "restore"
	CmdReplay              Command = "replay"
	CmdCancelBackup        Command = "cancelBackup"
	CmdResync              Command = "resync"
	CmdPITR                Command = "pitr"
	CmdDeleteBackup        Command = "delete"
	CmdDeletePITR          Command = "deletePitr"
	CmdCleanup             Command = "cleanup"
)

func (Command) String

func (c Command) String() string

type CursorClosedError

type CursorClosedError struct {
	Err error
}

func (CursorClosedError) Error

func (c CursorClosedError) Error() string

func (CursorClosedError) Is

func (c CursorClosedError) Is(err error) bool

func (CursorClosedError) Unwrap

func (c CursorClosedError) Unwrap() error

type DeleteBackupCmd

type DeleteBackupCmd struct {
	Backup    string          `bson:"backup"`
	OlderThan int64           `bson:"olderthan"`
	Type      defs.BackupType `bson:"type"`
}

func (DeleteBackupCmd) String

func (d DeleteBackupCmd) String() string

type DeletePITRCmd

type DeletePITRCmd struct {
	OlderThan int64 `bson:"olderthan"`
}

type OPID

type OPID primitive.ObjectID

func ParseOPID

func ParseOPID(s string) (OPID, error)

func SendAddConfigProfile

func SendAddConfigProfile(
	ctx context.Context,
	m connect.Client,
	name string,
	storage config.StorageConf,
) (OPID, error)

func SendCancelBackup

func SendCancelBackup(ctx context.Context, m connect.Client) (OPID, error)

func SendCleanup

func SendCleanup(
	ctx context.Context,
	m connect.Client,
	before primitive.Timestamp,
) (OPID, error)

func SendDeleteBackupBefore

func SendDeleteBackupBefore(
	ctx context.Context,
	m connect.Client,
	before primitive.Timestamp,
	type_ defs.BackupType,
) (OPID, error)

func SendDeleteBackupByName

func SendDeleteBackupByName(ctx context.Context, m connect.Client, name string) (OPID, error)

func SendDeleteOplogRangeBefore

func SendDeleteOplogRangeBefore(
	ctx context.Context,
	m connect.Client,
	before primitive.Timestamp,
) (OPID, error)

func SendRemoveConfigProfile

func SendRemoveConfigProfile(ctx context.Context, m connect.Client, name string) (OPID, error)

func SendResync

func SendResync(ctx context.Context, m connect.Client, opts *ResyncCmd) (OPID, error)

func (OPID) Obj

func (o OPID) Obj() primitive.ObjectID

func (OPID) String

func (o OPID) String() string

type ProfileCmd

type ProfileCmd struct {
	Name      string             `bson:"name"`
	IsProfile bool               `bson:"profile"`
	Storage   config.StorageConf `bson:"storage"`
}

type ReplayCmd

type ReplayCmd struct {
	Name  string              `bson:"name"`
	Start primitive.Timestamp `bson:"start,omitempty"`
	End   primitive.Timestamp `bson:"end,omitempty"`
	RSMap map[string]string   `bson:"rsMap,omitempty"`
}

func (ReplayCmd) String

func (c ReplayCmd) String() string

type RestoreCmd

type RestoreCmd struct {
	Name            string            `bson:"name"`
	BackupName      string            `bson:"backupName"`
	Namespaces      []string          `bson:"nss,omitempty"`
	NamespaceFrom   string            `bson:"nsFrom,omitempty"`
	NamespaceTo     string            `bson:"nsTo,omitempty"`
	UsersAndRoles   bool              `bson:"usersAndRoles,omitempty"`
	RSMap           map[string]string `bson:"rsMap,omitempty"`
	Fallback        *bool             `bson:"fallbackEnabled"`
	AllowPartlyDone *bool             `bson:"allowPartlyDone"`

	NumParallelColls    *int32 `bson:"numParallelColls,omitempty"`
	NumInsertionWorkers *int32 `bson:"numInsertionWorkers,omitempty"`

	OplogTS primitive.Timestamp `bson:"oplogTS,omitempty"`

	External bool                `bson:"external"`
	ExtConf  topo.ExternOpts     `bson:"extConf"`
	ExtTS    primitive.Timestamp `bson:"extTS"`
}

func (RestoreCmd) String

func (r RestoreCmd) String() string

type ResyncCmd

type ResyncCmd struct {
	Name            string `bson:"name,omitempty"`
	All             bool   `bson:"all,omitempty"`
	Clear           bool   `bson:"clear,omitempty"`
	IncludeRestores bool   `bson:"includeRestores,omitempty"`
}

Jump to

Keyboard shortcuts

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