noop

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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() *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       StorageHandlerIsInstalled
	HasStorageLocally StorageHandlerHasStorageLocally
	GetVolumeSize     StorageHandlerGetVolumeSize
	PrepareStorage    StorageHandlerPrepareStorage
	CleanupStorage    StorageHandlerCleanupStorage
	Upload            StorageHandlerUpload
	Explode           StorageHandlerExplode
}

type StorageHandlerCleanupStorage added in v1.0.1

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

type StorageHandlerExplode added in v1.0.1

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

type StorageHandlerGetVolumeSize added in v1.0.1

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

type StorageHandlerHasStorageLocally added in v1.0.1

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

type StorageHandlerIsInstalled added in v1.0.1

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

type StorageHandlerPrepareStorage added in v1.0.1

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

type StorageHandlerUpload added in v1.0.1

type StorageHandlerUpload 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