test

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Code generated by mockery v1.0.0

Code generated by mockery v1.0.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger added in v0.5.0

func NewLogger() *logrus.Entry

Types

type BackupService added in v0.4.0

type BackupService struct {
	mock.Mock
}

BackupService is an autogenerated mock type for the BackupService type

func (*BackupService) CreateSignedURL added in v0.4.0

func (_m *BackupService) CreateSignedURL(target v1.DownloadTarget, bucket string, ttl time.Duration) (string, error)

CreateSignedURL provides a mock function with given fields: target, bucket, ttl

func (*BackupService) DeleteBackupDir added in v0.4.0

func (_m *BackupService) DeleteBackupDir(bucket string, backupName string) error

DeleteBackupDir provides a mock function with given fields: bucket, backupName

func (*BackupService) DownloadBackup added in v0.4.0

func (_m *BackupService) DownloadBackup(bucket string, name string) (io.ReadCloser, error)

DownloadBackup provides a mock function with given fields: bucket, name

func (*BackupService) GetAllBackups added in v0.4.0

func (_m *BackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)

GetAllBackups provides a mock function with given fields: bucket

func (*BackupService) GetBackup added in v0.4.0

func (_m *BackupService) GetBackup(bucket string, name string) (*v1.Backup, error)

GetBackup provides a mock function with given fields: bucket, name

func (*BackupService) UploadBackup added in v0.4.0

func (_m *BackupService) UploadBackup(bucket string, name string, metadata io.ReadSeeker, backup io.ReadSeeker, log io.ReadSeeker) error

UploadBackup provides a mock function with given fields: bucket, name, metadata, backup, log

func (*BackupService) UploadRestoreLog added in v0.4.0

func (_m *BackupService) UploadRestoreLog(bucket string, backup string, restore string, log io.ReadSeeker) error

UploadRestoreLog provides a mock function with given fields: bucket, backup, restore, log

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) GetBackup added in v0.4.0

func (f *FakeBackupService) GetBackup(bucket, name string) (*v1.Backup, error)

func (*FakeBackupService) UploadBackup

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

type FakeDiscoveryHelper added in v0.4.0

type FakeDiscoveryHelper struct {
	ResourceList       []*metav1.APIResourceList
	Mapper             meta.RESTMapper
	AutoReturnResource bool
}

func NewFakeDiscoveryHelper added in v0.5.0

func NewFakeDiscoveryHelper(autoReturnResource bool, resources map[schema.GroupVersionResource]schema.GroupVersionResource) *FakeDiscoveryHelper

func (*FakeDiscoveryHelper) Refresh added in v0.4.0

func (dh *FakeDiscoveryHelper) Refresh() error

func (*FakeDiscoveryHelper) ResourceFor added in v0.5.0

func (*FakeDiscoveryHelper) Resources added in v0.4.0

func (dh *FakeDiscoveryHelper) Resources() []*metav1.APIResourceList

type FakeDynamicClient

type FakeDynamicClient struct {
	mock.Mock
}

func (*FakeDynamicClient) Create

func (*FakeDynamicClient) Get added in v0.5.0

func (*FakeDynamicClient) List

func (*FakeDynamicClient) Watch

type FakeDynamicFactory

type FakeDynamicFactory struct {
	mock.Mock
}

func (*FakeDynamicFactory) ClientForGroupVersionResource

func (df *FakeDynamicFactory) ClientForGroupVersionResource(gv schema.GroupVersion, 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, volumeAZ string) (string, error)

func (*FakeSnapshotService) CreateVolumeFromSnapshot

func (s *FakeSnapshotService) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (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, volumeAZ string) (string, *int64, error)

type ObjectStorageAdapter added in v0.4.0

type ObjectStorageAdapter struct {
	mock.Mock
}

ObjectStorageAdapter is an autogenerated mock type for the ObjectStorageAdapter type

func (*ObjectStorageAdapter) CreateSignedURL added in v0.4.0

func (_m *ObjectStorageAdapter) CreateSignedURL(bucket string, key string, ttl time.Duration) (string, error)

CreateSignedURL provides a mock function with given fields: bucket, key, ttl

func (*ObjectStorageAdapter) DeleteObject added in v0.4.0

func (_m *ObjectStorageAdapter) DeleteObject(bucket string, key string) error

DeleteObject provides a mock function with given fields: bucket, key

func (*ObjectStorageAdapter) GetObject added in v0.4.0

func (_m *ObjectStorageAdapter) GetObject(bucket string, key string) (io.ReadCloser, error)

GetObject provides a mock function with given fields: bucket, key

func (*ObjectStorageAdapter) ListCommonPrefixes added in v0.4.0

func (_m *ObjectStorageAdapter) ListCommonPrefixes(bucket string, delimiter string) ([]string, error)

ListCommonPrefixes provides a mock function with given fields: bucket, delimiter

func (*ObjectStorageAdapter) ListObjects added in v0.4.0

func (_m *ObjectStorageAdapter) ListObjects(bucket string, prefix string) ([]string, error)

ListObjects provides a mock function with given fields: bucket, prefix

func (*ObjectStorageAdapter) PutObject added in v0.4.0

func (_m *ObjectStorageAdapter) PutObject(bucket string, key string, body io.ReadSeeker) error

PutObject provides a mock function with given fields: bucket, key, body

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) WithSnapshotVolumes added in v0.4.0

func (b *TestBackup) WithSnapshotVolumes(value bool) *TestBackup

func (*TestBackup) WithSnapshotVolumesPointer added in v0.4.0

func (b *TestBackup) WithSnapshotVolumesPointer(value *bool) *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 NewDefaultTestRestore added in v0.4.0

func NewDefaultTestRestore() *TestRestore

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) WithExcludedNamespace added in v0.4.0

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

func (*TestRestore) WithExcludedResource added in v0.4.0

func (r *TestRestore) WithExcludedResource(resource string) *TestRestore

func (*TestRestore) WithIncludedNamespace added in v0.4.0

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

func (*TestRestore) WithIncludedResource added in v0.4.0

func (r *TestRestore) WithIncludedResource(resource string) *TestRestore

func (*TestRestore) WithMappedNamespace added in v0.4.0

func (r *TestRestore) WithMappedNamespace(from string, to string) *TestRestore

func (*TestRestore) WithRestorePVs added in v0.4.0

func (r *TestRestore) WithRestorePVs(value bool) *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