Documentation ¶
Index ¶
- Variables
- func AddProfile(ctx context.Context, m connect.Client, profile *Config) error
- func GetConfigVar(ctx context.Context, m connect.Client, key string) (interface{}, error)
- func IsPITREnabled(ctx context.Context, m connect.Client) (bool, bool, error)
- func RemoveProfile(ctx context.Context, m connect.Client, name string) error
- func SetConfig(ctx context.Context, m connect.Client, cfg *Config) error
- func SetConfigVar(ctx context.Context, m connect.Client, key, val string) error
- type BackupConf
- type BackupTimeouts
- type Config
- func GetConfig(ctx context.Context, m connect.Client) (*Config, error)
- func GetProfile(ctx context.Context, m connect.Client, name string) (*Config, error)
- func GetProfiledConfig(ctx context.Context, conn connect.Client, profile string) (*Config, error)
- func ListProfiles(ctx context.Context, m connect.Client) ([]Config, error)
- func Parse(r io.Reader) (*Config, error)
- type Epoch
- type PITRConf
- type Priority
- type RestoreConf
- type StorageConf
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnkownStorageType = errors.New("unknown storage type") ErrMissedConfig = errors.New("missed config") ErrMissedConfigProfile = errors.New("missed config profile") ErrUnsetConfigPath = bsoncore.ErrElementNotFound )
Functions ¶
func GetConfigVar ¶
GetConfigVar returns value of given config vaiable
Types ¶
type BackupConf ¶
type BackupConf struct { OplogSpanMin float64 `bson:"oplogSpanMin" json:"oplogSpanMin" yaml:"oplogSpanMin"` Priority Priority `bson:"priority,omitempty" json:"priority,omitempty" yaml:"priority,omitempty"` Timeouts *BackupTimeouts `bson:"timeouts,omitempty" json:"timeouts,omitempty" yaml:"timeouts,omitempty"` Compression compress.CompressionType `bson:"compression,omitempty" json:"compression,omitempty" yaml:"compression,omitempty"` CompressionLevel *int `bson:"compressionLevel,omitempty" json:"compressionLevel,omitempty" yaml:"compressionLevel,omitempty"` NumParallelCollections int `bson:"numParallelCollections" json:"numParallelCollections,omitempty" yaml:"numParallelCollections,omitempty"` }
func (*BackupConf) Clone ¶
func (cfg *BackupConf) Clone() *BackupConf
type BackupTimeouts ¶
type BackupTimeouts struct { // Starting is timeout (in seconds) to wait for a backup to start. Starting *uint32 `bson:"startingStatus,omitempty" json:"startingStatus,omitempty" yaml:"startingStatus,omitempty"` }
func (*BackupTimeouts) StartingStatus ¶
func (t *BackupTimeouts) StartingStatus() time.Duration
StartingStatus returns timeout duration for . If not set or zero, returns default value (WaitBackupStart).
type Config ¶
type Config struct { Name string `bson:"name,omitempty" json:"name,omitempty" yaml:"name,omitempty"` IsProfile bool `bson:"profile,omitempty" json:"profile,omitempty" yaml:"profile,omitempty"` Storage StorageConf `bson:"storage" json:"storage" yaml:"storage"` PITR *PITRConf `bson:"pitr,omitempty" json:"pitr,omitempty" yaml:"pitr,omitempty"` Backup *BackupConf `bson:"backup,omitempty" json:"backup,omitempty" yaml:"backup,omitempty"` Restore *RestoreConf `bson:"restore,omitempty" json:"restore,omitempty" yaml:"restore,omitempty"` Epoch primitive.Timestamp `bson:"epoch" json:"-" yaml:"-"` }
Config is a pbm config
func GetProfile ¶
func GetProfiledConfig ¶
func (*Config) BackupSlicerInterval ¶
BackupSlicerInterval returns interval for backup slicer routine. If it is not confugured, the function returns general oplog slicer interval.
func (*Config) OplogSlicerInterval ¶
OplogSlicerInterval returns interval for general oplog slicer routine. If it is not configured, the function returns default (hardcoded) value 10 mins.
type PITRConf ¶
type PITRConf struct { Enabled bool `bson:"enabled" json:"enabled" yaml:"enabled"` OplogSpanMin float64 `bson:"oplogSpanMin,omitempty" json:"oplogSpanMin,omitempty" yaml:"oplogSpanMin,omitempty"` OplogOnly bool `bson:"oplogOnly,omitempty" json:"oplogOnly,omitempty" yaml:"oplogOnly,omitempty"` Priority Priority `bson:"priority,omitempty" json:"priority,omitempty" yaml:"priority,omitempty"` Compression compress.CompressionType `bson:"compression,omitempty" json:"compression,omitempty" yaml:"compression,omitempty"` CompressionLevel *int `bson:"compressionLevel,omitempty" json:"compressionLevel,omitempty" yaml:"compressionLevel,omitempty"` }
PITRConf is a Point-In-Time Recovery options
type Priority ¶
Priority contains priority values for cluster members. It is used for specifying Backup and PITR configuration priorities.
type RestoreConf ¶
type RestoreConf struct { // Logical restore // // num of documents to buffer BatchSize int `bson:"batchSize" json:"batchSize,omitempty" yaml:"batchSize,omitempty"` NumInsertionWorkers int `bson:"numInsertionWorkers" json:"numInsertionWorkers,omitempty" yaml:"numInsertionWorkers,omitempty"` NumParallelCollections int `bson:"numParallelCollections" json:"numParallelCollections,omitempty" yaml:"numParallelCollections,omitempty"` // NumDownloadWorkers sets the num of goroutine would be requesting chunks // during the download. By default, it's set to GOMAXPROCS. NumDownloadWorkers int `bson:"numDownloadWorkers" json:"numDownloadWorkers,omitempty" yaml:"numDownloadWorkers,omitempty"` // MaxDownloadBufferMb sets the max size of the in-memory buffer that is used // to download files from the storage. MaxDownloadBufferMb int `bson:"maxDownloadBufferMb" json:"maxDownloadBufferMb,omitempty" yaml:"maxDownloadBufferMb,omitempty"` DownloadChunkMb int `bson:"downloadChunkMb" json:"downloadChunkMb,omitempty" yaml:"downloadChunkMb,omitempty"` // MongodLocation sets the location of mongod used for internal runs during // physical restore. Will try $PATH/mongod if not set. MongodLocation string `bson:"mongodLocation" json:"mongodLocation,omitempty" yaml:"mongodLocation,omitempty"` MongodLocationMap map[string]string `bson:"mongodLocationMap" json:"mongodLocationMap,omitempty" yaml:"mongodLocationMap,omitempty"` }
RestoreConf is config options for the restore
func (*RestoreConf) Clone ¶
func (cfg *RestoreConf) Clone() *RestoreConf
type StorageConf ¶
type StorageConf struct { Type storage.Type `bson:"type" json:"type" yaml:"type"` S3 *s3.Config `bson:"s3,omitempty" json:"s3,omitempty" yaml:"s3,omitempty"` Azure *azure.Config `bson:"azure,omitempty" json:"azure,omitempty" yaml:"azure,omitempty"` Filesystem *fs.Config `bson:"filesystem,omitempty" json:"filesystem,omitempty" yaml:"filesystem,omitempty"` }
StorageConf is a configuration of the backup storage
func (*StorageConf) Cast ¶
func (s *StorageConf) Cast() error
func (*StorageConf) Clone ¶
func (s *StorageConf) Clone() *StorageConf
func (*StorageConf) Equal ¶
func (s *StorageConf) Equal(other *StorageConf) bool
func (*StorageConf) Path ¶
func (s *StorageConf) Path() string
func (*StorageConf) Typ ¶
func (s *StorageConf) Typ() string