dummy

package
v0.0.0-...-e653fdf Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StorageProviders

func StorageProviders() storage.ProviderRegistry

StorageProviders returns a provider registry with some well-defined dummy storage providers.

Types

type FilesystemSource

type FilesystemSource struct {
	testing.Stub

	CreateFilesystemsFunc        func(context.ProviderCallContext, []storage.FilesystemParams) ([]storage.CreateFilesystemsResult, error)
	DestroyFilesystemsFunc       func(context.ProviderCallContext, []string) ([]error, error)
	ReleaseFilesystemsFunc       func(context.ProviderCallContext, []string) ([]error, error)
	ValidateFilesystemParamsFunc func(storage.FilesystemParams) error
	AttachFilesystemsFunc        func(context.ProviderCallContext, []storage.FilesystemAttachmentParams) ([]storage.AttachFilesystemsResult, error)
	DetachFilesystemsFunc        func(context.ProviderCallContext, []storage.FilesystemAttachmentParams) ([]error, error)
}

FilesystemSource is an implementation of storage.FilesystemSource, suitable for testing. Each method's default behaviour may be overridden by setting the corresponding Func field.

func (*FilesystemSource) AttachFilesystems

AttachFilesystems is defined on storage.FilesystemSource.

func (*FilesystemSource) CreateFilesystems

CreateFilesystems is defined on storage.FilesystemSource.

func (*FilesystemSource) DestroyFilesystems

func (s *FilesystemSource) DestroyFilesystems(ctx context.ProviderCallContext, volIds []string) ([]error, error)

DestroyFilesystems is defined on storage.FilesystemSource.

func (*FilesystemSource) DetachFilesystems

DetachFilesystems is defined on storage.FilesystemSource.

func (*FilesystemSource) ReleaseFilesystems

func (s *FilesystemSource) ReleaseFilesystems(ctx context.ProviderCallContext, volIds []string) ([]error, error)

ReleaseFilesystems is defined on storage.FilesystemSource.

func (*FilesystemSource) ValidateFilesystemParams

func (s *FilesystemSource) ValidateFilesystemParams(params storage.FilesystemParams) error

ValidateFilesystemParams is defined on storage.FilesystemSource.

type StorageProvider

type StorageProvider struct {
	testing.Stub

	// StorageScope defines the scope of storage managed by this provider.
	StorageScope storage.Scope

	// IsDynamic defines whether or not the provider reports that it supports
	// dynamic provisioning.
	IsDynamic bool

	// IsReleasable defines whether or not the provider reports that it
	// supports releasing storage.
	IsReleasable bool

	// DefaultPools_ will be returned by DefaultPools.
	DefaultPools_ []*storage.Config

	// VolumeSourceFunc will be called by VolumeSource, if non-nil;
	// otherwise VolumeSource will return a NotSupported error.
	VolumeSourceFunc func(*storage.Config) (storage.VolumeSource, error)

	// FilesystemSourceFunc will be called by FilesystemSource, if non-nil;
	// otherwise FilesystemSource will return a NotSupported error.
	FilesystemSourceFunc func(*storage.Config) (storage.FilesystemSource, error)

	// ValidateConfigFunc will be called by ValidateConfig, if non-nil;
	// otherwise ValidateConfig returns nil.
	ValidateConfigFunc func(*storage.Config) error

	// ValidateForK8sFunc will be called by ValidateForK8s, if non-nil;
	// otherwise ValidateForK8s returns nil.
	ValidateForK8sFunc func(map[string]any) error

	// SupportsFunc will be called by Supports, if non-nil; otherwise,
	// Supports returns true.
	SupportsFunc func(kind storage.StorageKind) bool
}

StorageProvider is an implementation of storage.Provider, suitable for testing. Each method's default behaviour may be overridden by setting the corresponding Func field.

func (*StorageProvider) DefaultPools

func (p *StorageProvider) DefaultPools() []*storage.Config

DefaultPool is defined on storage.Provider.

func (*StorageProvider) Dynamic

func (p *StorageProvider) Dynamic() bool

Dynamic is defined on storage.Provider.

func (*StorageProvider) FilesystemSource

func (p *StorageProvider) FilesystemSource(providerConfig *storage.Config) (storage.FilesystemSource, error)

FilesystemSource is defined on storage.Provider.

func (*StorageProvider) Releasable

func (p *StorageProvider) Releasable() bool

Releasable is defined on storage.Provider.

func (*StorageProvider) Scope

func (p *StorageProvider) Scope() storage.Scope

Scope is defined on storage.Provider.

func (*StorageProvider) Supports

func (p *StorageProvider) Supports(kind storage.StorageKind) bool

Supports is defined on storage.Provider.

func (*StorageProvider) ValidateConfig

func (p *StorageProvider) ValidateConfig(providerConfig *storage.Config) error

ValidateConfig is defined on storage.Provider.

func (*StorageProvider) ValidateForK8s

func (p *StorageProvider) ValidateForK8s(attributes map[string]any) error

func (*StorageProvider) VolumeSource

func (p *StorageProvider) VolumeSource(providerConfig *storage.Config) (storage.VolumeSource, error)

VolumeSource is defined on storage.Provider.

type VolumeSource

type VolumeSource struct {
	testing.Stub

	CreateVolumesFunc        func(context.ProviderCallContext, []storage.VolumeParams) ([]storage.CreateVolumesResult, error)
	ListVolumesFunc          func(context.ProviderCallContext) ([]string, error)
	DescribeVolumesFunc      func(context.ProviderCallContext, []string) ([]storage.DescribeVolumesResult, error)
	DestroyVolumesFunc       func(context.ProviderCallContext, []string) ([]error, error)
	ReleaseVolumesFunc       func(context.ProviderCallContext, []string) ([]error, error)
	ValidateVolumeParamsFunc func(storage.VolumeParams) error
	AttachVolumesFunc        func(context.ProviderCallContext, []storage.VolumeAttachmentParams) ([]storage.AttachVolumesResult, error)
	DetachVolumesFunc        func(context.ProviderCallContext, []storage.VolumeAttachmentParams) ([]error, error)
}

VolumeSource is an implementation of storage.VolumeSource, suitable for testing. Each method's default behaviour may be overridden by setting the corresponding Func field.

func (*VolumeSource) AttachVolumes

AttachVolumes is defined on storage.VolumeSource.

func (*VolumeSource) CreateVolumes

CreateVolumes is defined on storage.VolumeSource.

func (*VolumeSource) DescribeVolumes

func (s *VolumeSource) DescribeVolumes(ctx context.ProviderCallContext, volIds []string) ([]storage.DescribeVolumesResult, error)

DescribeVolumes is defined on storage.VolumeSource.

func (*VolumeSource) DestroyVolumes

func (s *VolumeSource) DestroyVolumes(ctx context.ProviderCallContext, volIds []string) ([]error, error)

DestroyVolumes is defined on storage.VolumeSource.

func (*VolumeSource) DetachVolumes

func (s *VolumeSource) DetachVolumes(ctx context.ProviderCallContext, params []storage.VolumeAttachmentParams) ([]error, error)

DetachVolumes is defined on storage.VolumeSource.

func (*VolumeSource) ListVolumes

func (s *VolumeSource) ListVolumes(ctx context.ProviderCallContext) ([]string, error)

ListVolumes is defined on storage.VolumeSource.

func (*VolumeSource) ReleaseVolumes

func (s *VolumeSource) ReleaseVolumes(ctx context.ProviderCallContext, volIds []string) ([]error, error)

ReleaseVolumes is defined on storage.VolumeSource.

func (*VolumeSource) ValidateVolumeParams

func (s *VolumeSource) ValidateVolumeParams(params storage.VolumeParams) error

ValidateVolumeParams is defined on storage.VolumeSource.

Jump to

Keyboard shortcuts

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