noop

package
v0.3.24 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopStorage

type NoopStorage struct {
	Config StorageConfig
}

func NewNoopStorage

func NewNoopStorage(config StorageConfig) *NoopStorage

func NewNoopStorageWithConfig

func NewNoopStorageWithConfig(config StorageConfig) *NoopStorage

func (*NoopStorage) CleanupStorage

func (s *NoopStorage) CleanupStorage(ctx context.Context, storageSpec model.StorageSpec, volume storage.StorageVolume) error

func (*NoopStorage) Explode

func (s *NoopStorage) Explode(ctx context.Context, spec model.StorageSpec) ([]model.StorageSpec, error)

func (*NoopStorage) GetVolumeSize

func (s *NoopStorage) GetVolumeSize(ctx context.Context, volume model.StorageSpec) (uint64, error)

we wrap this in a timeout because if the CID is not present on the network this seems to hang

func (*NoopStorage) HasStorageLocally

func (s *NoopStorage) HasStorageLocally(ctx context.Context, volume model.StorageSpec) (bool, error)

func (*NoopStorage) IsInstalled

func (s *NoopStorage) IsInstalled(ctx context.Context) (bool, error)

func (*NoopStorage) PrepareStorage

func (s *NoopStorage) PrepareStorage(ctx context.Context, storageSpec model.StorageSpec) (storage.StorageVolume, error)

func (*NoopStorage) Upload

func (s *NoopStorage) Upload(ctx context.Context, localPath string) (model.StorageSpec, error)

type StorageConfig

type StorageConfig struct {
	ExternalHooks StorageConfigExternalHooks
}

type StorageConfigExternalHooks

type StorageConfigExternalHooks struct {
	IsInstalled       StroageHandlerIsInstalled
	HasStorageLocally StroageHandlerHasStorageLocally
	GetVolumeSize     StroageHandlerGetVolumeSize
	PrepareStorage    StroageHandlerPrepareStorage
	CleanupStorage    StroageHandlerCleanupStorage
	Upload            StroageHandlerUpload
	Explode           StroageHandlerExplode
}

type StroageHandlerCleanupStorage

type StroageHandlerCleanupStorage func(ctx context.Context, storageSpec model.StorageSpec, volume storage.StorageVolume) error

type StroageHandlerExplode

type StroageHandlerExplode func(ctx context.Context, storageSpec model.StorageSpec) ([]model.StorageSpec, error)

type StroageHandlerGetVolumeSize

type StroageHandlerGetVolumeSize func(ctx context.Context, volume model.StorageSpec) (uint64, error)

type StroageHandlerHasStorageLocally

type StroageHandlerHasStorageLocally func(ctx context.Context, volume model.StorageSpec) (bool, error)

type StroageHandlerIsInstalled

type StroageHandlerIsInstalled func(ctx context.Context) (bool, error)

type StroageHandlerPrepareStorage

type StroageHandlerPrepareStorage func(ctx context.Context, storageSpec model.StorageSpec) (storage.StorageVolume, error)

type StroageHandlerUpload

type StroageHandlerUpload func(ctx context.Context, localPath string) (model.StorageSpec, error)

Jump to

Keyboard shortcuts

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