test

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeBackupService

type FakeBackupService struct {
	mock.Mock
}

func (*FakeBackupService) DeleteBackup

func (f *FakeBackupService) DeleteBackup(bucket, backupName string) error

func (*FakeBackupService) DownloadBackup

func (f *FakeBackupService) DownloadBackup(bucket, name string) (io.ReadCloser, error)

func (*FakeBackupService) GetAllBackups

func (f *FakeBackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)

func (*FakeBackupService) UploadBackup

func (f *FakeBackupService) UploadBackup(bucket, name string, metadata, backup io.ReadSeeker) error

type FakeDynamicClient

type FakeDynamicClient struct {
	mock.Mock
}

func (*FakeDynamicClient) Create

func (*FakeDynamicClient) List

func (*FakeDynamicClient) Watch

type FakeDynamicFactory

type FakeDynamicFactory struct {
	mock.Mock
}

func (*FakeDynamicFactory) ClientForGroupVersionKind

func (df *FakeDynamicFactory) ClientForGroupVersionKind(gvk schema.GroupVersionKind, resource metav1.APIResource, namespace string) (client.Dynamic, error)

func (*FakeDynamicFactory) ClientForGroupVersionResource

func (df *FakeDynamicFactory) ClientForGroupVersionResource(gvr schema.GroupVersionResource, resource metav1.APIResource, namespace string) (client.Dynamic, error)

type FakeMapper

type FakeMapper struct {
	meta.RESTMapper
	AutoReturnResource bool
	Resources          map[schema.GroupVersionResource]schema.GroupVersionResource
}

func (*FakeMapper) ResourceFor

type FakeSnapshotService

type FakeSnapshotService struct {
	// SnapshotID->VolumeID
	SnapshotsTaken sets.String

	// VolumeID -> (SnapshotID, Type, Iops)
	SnapshottableVolumes map[string]api.VolumeBackupInfo

	// VolumeBackupInfo -> VolumeID
	RestorableVolumes map[api.VolumeBackupInfo]string
}

func (*FakeSnapshotService) CreateSnapshot

func (s *FakeSnapshotService) CreateSnapshot(volumeID string) (string, error)

func (*FakeSnapshotService) CreateVolumeFromSnapshot

func (s *FakeSnapshotService) CreateVolumeFromSnapshot(snapshotID, volumeType string, iops *int) (string, error)

func (*FakeSnapshotService) DeleteSnapshot

func (s *FakeSnapshotService) DeleteSnapshot(snapshotID string) error

func (*FakeSnapshotService) GetAllSnapshots

func (s *FakeSnapshotService) GetAllSnapshots() ([]string, error)

func (*FakeSnapshotService) GetVolumeInfo

func (s *FakeSnapshotService) GetVolumeInfo(volumeID string) (string, *int, error)

type TestBackup

type TestBackup struct {
	*v1.Backup
}

func NewTestBackup

func NewTestBackup() *TestBackup

func (*TestBackup) WithExcludedNamespaces

func (b *TestBackup) WithExcludedNamespaces(ns ...string) *TestBackup

func (*TestBackup) WithExcludedResources

func (b *TestBackup) WithExcludedResources(r ...string) *TestBackup

func (*TestBackup) WithExpiration

func (b *TestBackup) WithExpiration(expiration time.Time) *TestBackup

func (*TestBackup) WithIncludedNamespaces

func (b *TestBackup) WithIncludedNamespaces(ns ...string) *TestBackup

func (*TestBackup) WithIncludedResources

func (b *TestBackup) WithIncludedResources(r ...string) *TestBackup

func (*TestBackup) WithLabel

func (b *TestBackup) WithLabel(key, value string) *TestBackup

func (*TestBackup) WithName

func (b *TestBackup) WithName(name string) *TestBackup

func (*TestBackup) WithNamespace

func (b *TestBackup) WithNamespace(namespace string) *TestBackup

func (*TestBackup) WithPhase

func (b *TestBackup) WithPhase(phase v1.BackupPhase) *TestBackup

func (*TestBackup) WithSnapshot

func (b *TestBackup) WithSnapshot(pv string, snapshot string) *TestBackup

func (*TestBackup) WithTTL

func (b *TestBackup) WithTTL(ttl time.Duration) *TestBackup

func (*TestBackup) WithVersion

func (b *TestBackup) WithVersion(version int) *TestBackup

type TestRestore

type TestRestore struct {
	*api.Restore
}

func NewTestRestore

func NewTestRestore(ns, name string, phase api.RestorePhase) *TestRestore

func (*TestRestore) WithBackup

func (r *TestRestore) WithBackup(name string) *TestRestore

func (*TestRestore) WithErrors

func (r *TestRestore) WithErrors(e api.RestoreResult) *TestRestore

func (*TestRestore) WithRestorableNamespace

func (r *TestRestore) WithRestorableNamespace(name string) *TestRestore

func (*TestRestore) WithValidationError

func (r *TestRestore) WithValidationError(err string) *TestRestore

type TestSchedule

type TestSchedule struct {
	*api.Schedule
}

func NewTestSchedule

func NewTestSchedule(namespace, name string) *TestSchedule

func (*TestSchedule) WithCronSchedule

func (s *TestSchedule) WithCronSchedule(cronExpression string) *TestSchedule

func (*TestSchedule) WithLastBackupTime

func (s *TestSchedule) WithLastBackupTime(timeString string) *TestSchedule

func (*TestSchedule) WithPhase

func (s *TestSchedule) WithPhase(phase api.SchedulePhase) *TestSchedule

func (*TestSchedule) WithValidationError

func (s *TestSchedule) WithValidationError(msg string) *TestSchedule

Jump to

Keyboard shortcuts

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