Documentation ¶
Index ¶
- Variables
- func IsURLSupported(rawURL string) (*url.URL, error)
- func NewSpecConfig(url string) (*models.SpecConfig, error)
- type Source
- type StorageProvider
- func (sp *StorageProvider) CleanupStorage(ctx context.Context, _ models.InputSource, volume storage.StorageVolume) error
- func (sp *StorageProvider) GetVolumeSize(ctx context.Context, storageSpec models.InputSource) (uint64, error)
- func (sp *StorageProvider) HasStorageLocally(context.Context, models.InputSource) (bool, error)
- func (sp *StorageProvider) IsInstalled(context.Context) (bool, error)
- func (sp *StorageProvider) PrepareStorage(ctx context.Context, storageDirectory string, storageSpec models.InputSource) (storage.StorageVolume, error)
- func (sp *StorageProvider) Upload(context.Context, string) (models.SpecConfig, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoContentLengthFound = errors.New("content-length not provided by the server")
)
Functions ¶
func NewSpecConfig ¶ added in v1.4.0
func NewSpecConfig(url string) (*models.SpecConfig, error)
Types ¶
type Source ¶ added in v1.0.4
type Source struct {
URL string
}
func DecodeSpec ¶ added in v1.0.4
func DecodeSpec(spec *models.SpecConfig) (Source, error)
type StorageProvider ¶
type StorageProvider struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage(timeout time.Duration, maxRetries int) *StorageProvider
func (*StorageProvider) CleanupStorage ¶
func (sp *StorageProvider) CleanupStorage( ctx context.Context, _ models.InputSource, volume storage.StorageVolume, ) error
func (*StorageProvider) GetVolumeSize ¶
func (sp *StorageProvider) GetVolumeSize(ctx context.Context, storageSpec models.InputSource) (uint64, error)
func (*StorageProvider) HasStorageLocally ¶
func (sp *StorageProvider) HasStorageLocally(context.Context, models.InputSource) (bool, error)
func (*StorageProvider) IsInstalled ¶
func (sp *StorageProvider) IsInstalled(context.Context) (bool, error)
func (*StorageProvider) PrepareStorage ¶
func (sp *StorageProvider) PrepareStorage( ctx context.Context, storageDirectory string, storageSpec models.InputSource) (storage.StorageVolume, error)
PrepareStorage will download the file from the URL
func (*StorageProvider) Upload ¶
func (sp *StorageProvider) Upload(context.Context, string) (models.SpecConfig, error)
Click to show internal directories.
Click to hide internal directories.