builder

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2020 the Velero contributors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAnnotations

func WithAnnotations(vals ...string) func(obj metav1.Object)

WithAnnotations is a functional option that applies the specified annotation keys/values to an object.

func WithClusterName

func WithClusterName(val string) func(obj metav1.Object)

WithClusterName is a functional option that applies the specified cluster name to an object.

func WithDeletionTimestamp

func WithDeletionTimestamp(val time.Time) func(obj metav1.Object)

WithDeletionTimestamp is a functional option that applies the specified deletion timestamp to an object.

func WithFinalizers

func WithFinalizers(vals ...string) func(obj metav1.Object)

WithFinalizers is a functional option that applies the specified finalizers to an object.

func WithGenerateName

func WithGenerateName(val string) func(obj metav1.Object)

WithGenerateName is a functional option that applies the specified generate name to an object.

func WithLabels

func WithLabels(vals ...string) func(obj metav1.Object)

WithLabels is a functional option that applies the specified label keys/values to an object.

func WithLabelsMap

func WithLabelsMap(labels map[string]string) func(obj metav1.Object)

WithLabelsMap is a functional option that applies the specified labels map to an object.

func WithName

func WithName(val string) func(obj metav1.Object)

WithName is a functional option that applies the specified name to an object.

func WithUID

func WithUID(val string) func(obj metav1.Object)

WithUID is a functional option that applies the specified UID to an object.

Types

type BackupRepositoryBuilder added in v1.1.0

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

BackupRepositoryBuilder builds BackupRepository objects.

func ForBackupRepository added in v1.1.0

func ForBackupRepository(name string) *BackupRepositoryBuilder

func (*BackupRepositoryBuilder) AllowedNamespaces added in v1.1.0

func (b *BackupRepositoryBuilder) AllowedNamespaces(allowedNamespaces []string) *BackupRepositoryBuilder

AllowedNamespaces sets the allowed namespaces for the backup repository.

func (*BackupRepositoryBuilder) BackupRepositoryClaim added in v1.1.0

func (b *BackupRepositoryBuilder) BackupRepositoryClaim(backupRepositoryClaimName string) *BackupRepositoryBuilder

BackupRepositoryClaim sets the name of the backup repository claim for this specific backup repository.

func (*BackupRepositoryBuilder) RepositoryDriver added in v1.1.0

func (b *BackupRepositoryBuilder) RepositoryDriver() *BackupRepositoryBuilder

RepositoryDriver sets the repository driver the backup repository. Currently only s3 is supported.

func (*BackupRepositoryBuilder) RepositoryParameters added in v1.1.0

func (b *BackupRepositoryBuilder) RepositoryParameters(repositoryParameters map[string]string) *BackupRepositoryBuilder

RepositoryParameters sets the parameters for the backup repository, these mostly include the credentials.

func (*BackupRepositoryBuilder) Result added in v1.1.0

Result returns the built BackupRepository.

func (*BackupRepositoryBuilder) SvcBackupRepositoryName added in v1.1.0

func (b *BackupRepositoryBuilder) SvcBackupRepositoryName(svcBackupRepositoryName string) *BackupRepositoryBuilder

SvcBackupRepositoryName sets the name of the supervisor backup repository corresponding to this specific backup repository, if it is not empty. This is available only for guest clusters.

type BackupRepositoryClaimBuilder added in v1.1.0

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

BackupRepositoryClaimBuilder builds BackupRepositoryClaim objects.

func ForBackupRepositoryClaim added in v1.1.0

func ForBackupRepositoryClaim(ns, name string) *BackupRepositoryClaimBuilder

func (*BackupRepositoryClaimBuilder) AllowedNamespaces added in v1.1.0

func (b *BackupRepositoryClaimBuilder) AllowedNamespaces(allowedNamespaces []string) *BackupRepositoryClaimBuilder

AllowedNamespaces sets the allowed namespaces for the backup repository claim.

func (*BackupRepositoryClaimBuilder) BackupRepository added in v1.1.0

func (b *BackupRepositoryClaimBuilder) BackupRepository(backupRepositoryName string) *BackupRepositoryClaimBuilder

BackupRepository sets the name of the backup repository for this specific backup repository claim.

func (*BackupRepositoryClaimBuilder) RepositoryDriver added in v1.1.0

RepositoryDriver sets the repository driver the backup repository claim. Currently only s3 is supported.

func (*BackupRepositoryClaimBuilder) RepositoryParameters added in v1.1.0

func (b *BackupRepositoryClaimBuilder) RepositoryParameters(repositoryParameters map[string]string) *BackupRepositoryClaimBuilder

RepositoryParameters sets the parameters for the backup repository claim, these mostly include the credentials.

func (*BackupRepositoryClaimBuilder) Result added in v1.1.0

Result returns the built BackupRepositoryClaim.

type CloneFromSnapshotBuilder added in v1.1.0

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

SnapshotBuilder builds Snapshot objects.

func ForCloneFromSnapshot added in v1.1.0

func ForCloneFromSnapshot(ns, name string, labels map[string]string) *CloneFromSnapshotBuilder

func (*CloneFromSnapshotBuilder) APIGroup added in v1.1.0

func (*CloneFromSnapshotBuilder) BackupRepository added in v1.1.0

func (b *CloneFromSnapshotBuilder) BackupRepository(backupRepositoryName string) *CloneFromSnapshotBuilder

BackupRepository sets the name of the backup repository for this specific snapshot.

func (*CloneFromSnapshotBuilder) CancelState added in v1.1.0

func (b *CloneFromSnapshotBuilder) CancelState(cancelState bool) *CloneFromSnapshotBuilder

Set the spec cancel state

func (*CloneFromSnapshotBuilder) Kind added in v1.1.0

func (*CloneFromSnapshotBuilder) Metadata added in v1.1.0

func (b *CloneFromSnapshotBuilder) Metadata(metadata []byte) *CloneFromSnapshotBuilder

func (*CloneFromSnapshotBuilder) Result added in v1.1.0

Result returns the built Snapshot.

func (*CloneFromSnapshotBuilder) SnapshotID added in v1.1.0

func (b *CloneFromSnapshotBuilder) SnapshotID(snapshotID string) *CloneFromSnapshotBuilder

type DeleteSnapshotBuilder added in v1.1.0

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

DeleteSnapshotBuilder builds DeleteSnapshot objects.

func ForDeleteSnapshot added in v1.1.0

func ForDeleteSnapshot(ns, name string) *DeleteSnapshotBuilder

func (*DeleteSnapshotBuilder) BackupRepository added in v1.1.0

func (b *DeleteSnapshotBuilder) BackupRepository(backupRepositoryName string) *DeleteSnapshotBuilder

BackupRepository sets the name of the backup repository for this specific delete snapshot.

func (*DeleteSnapshotBuilder) Result added in v1.1.0

Result returns the built DeleteSnapshot.

func (*DeleteSnapshotBuilder) SnapshotID added in v1.1.0

func (b *DeleteSnapshotBuilder) SnapshotID(snapshotID string) *DeleteSnapshotBuilder

SnapshotID set the snap-id for this specific delete snapshot request.

type DownloadBuilder

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

DownloadBuilder builds Download objects

func ForDownload

func ForDownload(ns, name string) *DownloadBuilder

ForDownload is the constructor for a DownloadBuilder.

func (*DownloadBuilder) BackupRepositoryName added in v1.1.0

func (b *DownloadBuilder) BackupRepositoryName(brName string) *DownloadBuilder

BackupRepositoryName sets the backuprepository name for the to be restored volume.

func (*DownloadBuilder) CloneFromSnapshotReference added in v1.1.0

func (b *DownloadBuilder) CloneFromSnapshotReference(cloneFromSnapshotRef string) *DownloadBuilder

CloneFromSnapshotReference sets the reference to the clonefromsnapshot.

func (*DownloadBuilder) CompletionTimestamp

func (b *DownloadBuilder) CompletionTimestamp(val time.Time) *DownloadBuilder

CompletionTimestamp sets the Download's end timestamp.

func (*DownloadBuilder) NextRetryTimestamp

func (b *DownloadBuilder) NextRetryTimestamp(val time.Time) *DownloadBuilder

NextRetryTimestamp sets the timestamp for next retry.

func (*DownloadBuilder) ObjectMeta

func (b *DownloadBuilder) ObjectMeta(opts ...ObjectMetaOpt) *DownloadBuilder

ObjectMeta applies functional options to the Download's ObjectMeta.

func (*DownloadBuilder) Phase

Phase sets the Download's phase.

func (*DownloadBuilder) ProcessingNode

func (b *DownloadBuilder) ProcessingNode(node string) *DownloadBuilder

ProcessingNode sets the DataManager node that has picked up the Download for processing.

func (*DownloadBuilder) ProtectedEntityID added in v1.1.0

func (b *DownloadBuilder) ProtectedEntityID(id string) *DownloadBuilder

ProtectedEntityID sets the identifier for the to be restored protected entity in the Spec.

func (*DownloadBuilder) RestoreTimestamp

func (b *DownloadBuilder) RestoreTimestamp(val time.Time) *DownloadBuilder

RestoreTimestamp sets the start time of download creation.

func (*DownloadBuilder) Result

func (b *DownloadBuilder) Result() *velerov1api.Download

Result returns the built Download.

func (*DownloadBuilder) Retry

func (b *DownloadBuilder) Retry(cnt int32) *DownloadBuilder

Retry sets the number of retry time.

func (*DownloadBuilder) SnapshotID

func (b *DownloadBuilder) SnapshotID(snapshotID string) *DownloadBuilder

SnapshotID sets the Download's snapshot ID.

func (*DownloadBuilder) StartTimestamp

func (b *DownloadBuilder) StartTimestamp(val time.Time) *DownloadBuilder

StartTimestamp sets the Download's start timestamp.

func (*DownloadBuilder) VolumeID

func (b *DownloadBuilder) VolumeID(id string) *DownloadBuilder

VolumeID sets the identifier for the restored volume in the Status.

type ObjectMetaOpt

type ObjectMetaOpt func(metav1.Object)

ObjectMetaOpt is a functional option for ObjectMeta.

type SnapshotBuilder added in v1.1.0

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

SnapshotBuilder builds Snapshot objects.

func ForSnapshot added in v1.1.0

func ForSnapshot(ns, name string, labels map[string]string) *SnapshotBuilder

func (*SnapshotBuilder) BackupRepository added in v1.1.0

func (b *SnapshotBuilder) BackupRepository(backupRepositoryName string) *SnapshotBuilder

BackupRepository sets the name of the backup repository for this specific snapshot.

func (*SnapshotBuilder) CancelState added in v1.1.0

func (b *SnapshotBuilder) CancelState(cancelState bool) *SnapshotBuilder

Set the spec cancel state

func (*SnapshotBuilder) ObjectReference added in v1.1.0

func (b *SnapshotBuilder) ObjectReference(objectToSnapshot core_v1.TypedLocalObjectReference) *SnapshotBuilder

Set the spec object reference

func (*SnapshotBuilder) Result added in v1.1.0

Result returns the built Snapshot.

type UploadBuilder

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

UploadBuilder builds Upload objects

func ForUpload

func ForUpload(ns, name string) *UploadBuilder

ForUpload is the constructor for a UploadBuilder.

func (*UploadBuilder) BackupRepositoryName added in v1.1.0

func (b *UploadBuilder) BackupRepositoryName(backuprepo string) *UploadBuilder

BackupRepository sets the backup repository for upload.

func (*UploadBuilder) BackupTimestamp

func (b *UploadBuilder) BackupTimestamp(val time.Time) *UploadBuilder

BackupTimestamp sets the start time of upload creation.

func (*UploadBuilder) CompletionTimestamp

func (b *UploadBuilder) CompletionTimestamp(val time.Time) *UploadBuilder

CompletionTimestamp sets the Upload's end timestamp.

func (*UploadBuilder) CurrentBackOff

func (b *UploadBuilder) CurrentBackOff(backoff int32) *UploadBuilder

CurrentBackOff sets the current backoff for upload retry.

func (*UploadBuilder) NextRetryTimestamp

func (b *UploadBuilder) NextRetryTimestamp(val time.Time) *UploadBuilder

NextRetryTimestamp sets the timestamp for next retry.

func (*UploadBuilder) ObjectMeta

func (b *UploadBuilder) ObjectMeta(opts ...ObjectMetaOpt) *UploadBuilder

ObjectMeta applies functional options to the Upload's ObjectMeta.

func (*UploadBuilder) Phase

Phase sets the Upload's phase.

func (*UploadBuilder) ProcessingNode

func (b *UploadBuilder) ProcessingNode(node string) *UploadBuilder

ProcessingNode sets the DataManager node that has picked up the Upload for processing.

func (*UploadBuilder) Result

func (b *UploadBuilder) Result() *velerov1api.Upload

Result returns the built Upload.

func (*UploadBuilder) Retry

func (b *UploadBuilder) Retry(cnt int32) *UploadBuilder

Retry sets the number of retry time.

func (*UploadBuilder) SnapshotID

func (b *UploadBuilder) SnapshotID(snapshotID string) *UploadBuilder

SnapshotID sets the Upload's snapshot ID.

func (*UploadBuilder) SnapshotReference added in v1.1.0

func (b *UploadBuilder) SnapshotReference(snapshotRef string) *UploadBuilder

SnapshotReference sets the reference to the snapshot.

func (*UploadBuilder) StartTimestamp

func (b *UploadBuilder) StartTimestamp(val time.Time) *UploadBuilder

StartTimestamp sets the Upload's start timestamp.

Jump to

Keyboard shortcuts

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