collections

package
v1.1.1-0...-66c8b0b Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const KindCollection = "backupcollections"

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupWindow

type BackupWindow struct {
	From     string `json:"from"`
	Duration string `json:"duration"`
	// contains filtered or unexported fields
}

func NewBackupWindow

func NewBackupWindow(from string, duration string) (BackupWindow, error)

NewBackupWindow is a factory method

func (*BackupWindow) GetStartingDateOfPreviousScheduledRun

func (b *BackupWindow) GetStartingDateOfPreviousScheduledRun(current time.Time) (time.Time, error)

func (*BackupWindow) IsInPreviousWindowTimeSlot

func (b *BackupWindow) IsInPreviousWindowTimeSlot(now time.Time, latestVersionCreation time.Time) (bool, error)

func (*BackupWindow) IsInWindowNow

func (b *BackupWindow) IsInWindowNow(current time.Time) (bool, error)

IsInWindowNow checks if given time is between BackupWindow time slot (<-start--O--end->)

func (*BackupWindow) UnmarshalJSON

func (b *BackupWindow) UnmarshalJSON(in []byte) error

UnmarshalJSON performs a validation when decoding a JSON

type BackupWindows

type BackupWindows []BackupWindow

type Collection

type Collection struct {
	Metadata         config.ObjectMetadata `json:"metadata"`
	Spec             Spec                  `json:"spec"`
	SecretFromSecret string
}

func (*Collection) CanDownloadFromMe

func (c *Collection) CanDownloadFromMe(user security.Actor) bool

CanDownloadFromMe answers if user can download versions to this collection

func (*Collection) CanListMyVersions

func (c *Collection) CanListMyVersions(user security.Actor) bool

CanListMyVersions answers if user can list versions

func (*Collection) CanUploadToMe

func (c *Collection) CanUploadToMe(user security.Actor) bool

CanUploadToMe answers if user can add new versions to the collection

func (*Collection) GenerateNextVersionFilename

func (c *Collection) GenerateNextVersionFilename(version int) string

func (*Collection) GetAccessControlList

func (c *Collection) GetAccessControlList() *security.AccessControlList

func (*Collection) GetCollectionMaxSize

func (c *Collection) GetCollectionMaxSize() (int64, error)

func (*Collection) GetEstimatedCollectionExtraSpace

func (c *Collection) GetEstimatedCollectionExtraSpace() (int64, error)

GetEstimatedCollectionExtraSpace returns total space that can be extra allocated in case, when a single version exceeds its limit. Returned value is estimated, does not include real state.

func (*Collection) GetGlobalIdentifier

func (c *Collection) GetGlobalIdentifier() string

func (*Collection) GetId

func (c *Collection) GetId() string

func (*Collection) GetMaxOneVersionSizeInBytes

func (c *Collection) GetMaxOneVersionSizeInBytes() (int64, error)

func (*Collection) GetTypeName

func (c *Collection) GetTypeName() string

func (*Collection) IsHealthCheckSecretValid

func (c *Collection) IsHealthCheckSecretValid(secret string) bool

type Service

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

func NewService

func NewService(config config.ConfigurationProvider) Service

func (*Service) GetCollectionById

func (s *Service) GetCollectionById(id string) (*Collection, error)

func (*Service) ValidateIsBackupWindowAllowingToUpload

func (s *Service) ValidateIsBackupWindowAllowingToUpload(collection *Collection, contextTime time.Time) bool

type Spec

type Spec struct {
	Description       string                         `json:"description"`
	FilenameTemplate  string                         `json:"filenameTemplate"`
	MaxBackupsCount   int                            `json:"maxBackupsCount"`
	MaxOneVersionSize string                         `json:"maxOneVersionSize"`
	MaxCollectionSize string                         `json:"maxCollectionSize"`
	Windows           BackupWindows                  `json:"windows"`
	StrategyName      string                         `json:"strategyName"`
	StrategySpec      StrategySpec                   `json:"strategySpec"`
	AccessControl     security.AccessControlList     `json:"accessControl"`
	HealthSecretRef   security.PasswordFromSecretRef `json:"healthSecretRef"`
}

type StrategySpec

type StrategySpec struct {
	KeepLastOlderNotMoreThan string `json:"keepLastOlderNotMoreThan"`
	MaxOlderCopies           int    `json:"maxOlderCopies"`
}

Jump to

Keyboard shortcuts

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