noop

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 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 models.InputSource, volume storage.StorageVolume) error

func (*NoopStorage) GetVolumeSize

func (s *NoopStorage) GetVolumeSize(ctx context.Context, volume models.InputSource) (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 models.InputSource) (bool, error)

func (*NoopStorage) IsInstalled

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

func (*NoopStorage) PrepareStorage

func (s *NoopStorage) PrepareStorage(
	ctx context.Context,
	storageDir string,
	storageSpec models.InputSource) (storage.StorageVolume, error)

func (*NoopStorage) Upload

func (s *NoopStorage) Upload(ctx context.Context, localPath string) (models.SpecConfig, 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
}

type StorageHandlerCleanupStorage added in v1.0.1

type StorageHandlerCleanupStorage func(
	ctx context.Context, storageSpec models.InputSource, volume storage.StorageVolume) error

type StorageHandlerGetVolumeSize added in v1.0.1

type StorageHandlerGetVolumeSize func(ctx context.Context, volume models.InputSource) (uint64, error)

type StorageHandlerHasStorageLocally added in v1.0.1

type StorageHandlerHasStorageLocally func(ctx context.Context, volume models.InputSource) (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, storageDir string, storageSpec models.InputSource) (storage.StorageVolume, error)

type StorageHandlerUpload added in v1.0.1

type StorageHandlerUpload func(ctx context.Context, localPath string) (models.SpecConfig, error)

Jump to

Keyboard shortcuts

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