storage

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModuleArchiveFormat = "tar.gz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureStorage added in v0.14.0

type AzureStorage struct {
	// contains filtered or unexported fields
}

AzureStorage is a Storage implementation backed by Azure Blob Storage. AzureStorage implements module.Storage, provider.Storage, and mirror.Storage

func (*AzureStorage) GetMirroredProvider added in v0.14.0

func (s *AzureStorage) GetMirroredProvider(ctx context.Context, provider *core.Provider) (*core.Provider, error)

func (*AzureStorage) GetModule added in v0.14.0

func (s *AzureStorage) GetModule(ctx context.Context, namespace, name, provider, version string) (core.Module, error)

GetModule retrieves information about a module from the Azure Storage.

func (*AzureStorage) GetProvider added in v0.14.0

func (s *AzureStorage) GetProvider(ctx context.Context, namespace, name, version, os, arch string) (*core.Provider, error)

func (*AzureStorage) ListMirroredProviders added in v0.14.0

func (s *AzureStorage) ListMirroredProviders(ctx context.Context, provider *core.Provider) ([]*core.Provider, error)

func (*AzureStorage) ListModuleVersions added in v0.14.0

func (s *AzureStorage) ListModuleVersions(ctx context.Context, namespace, name, provider string) ([]core.Module, error)

func (*AzureStorage) ListProviderVersions added in v0.14.0

func (s *AzureStorage) ListProviderVersions(ctx context.Context, namespace, name string) (*core.ProviderVersions, error)

func (*AzureStorage) MirroredSha256Sum added in v0.14.0

func (s *AzureStorage) MirroredSha256Sum(ctx context.Context, provider *core.Provider) (*core.Sha256Sums, error)

func (*AzureStorage) MirroredSigningKeys added in v0.14.0

func (s *AzureStorage) MirroredSigningKeys(ctx context.Context, hostname, namespace string) (*core.SigningKeys, error)

func (*AzureStorage) SigningKeys added in v0.14.0

func (s *AzureStorage) SigningKeys(ctx context.Context, namespace string) (*core.SigningKeys, error)

SigningKeys downloads the JSON placed in the namespace in Azure Blob Storage and unmarshals it into a core.SigningKeys

func (*AzureStorage) UploadMirroredFile added in v0.14.0

func (s *AzureStorage) UploadMirroredFile(ctx context.Context, provider *core.Provider, fileName string, reader io.Reader) error

func (*AzureStorage) UploadMirroredSigningKeys added in v0.14.0

func (s *AzureStorage) UploadMirroredSigningKeys(ctx context.Context, hostname, namespace string, signingKeys *core.SigningKeys) error

func (*AzureStorage) UploadModule added in v0.14.0

func (s *AzureStorage) UploadModule(ctx context.Context, namespace, name, provider, version string, body io.Reader) (core.Module, error)

func (*AzureStorage) UploadProviderReleaseFiles added in v0.14.0

func (s *AzureStorage) UploadProviderReleaseFiles(ctx context.Context, namespace, name, filename string, file io.Reader) error

type AzureStorageOption added in v0.14.0

type AzureStorageOption func(*AzureStorage)

AzureStorageOption provides additional options for the AzureStorage.

func WithAzureStorageArchiveFormat added in v0.14.0

func WithAzureStorageArchiveFormat(archiveFormat string) AzureStorageOption

WithAzureStorageArchiveFormat configures the module archive format (zip, tar, tgz, etc.)

func WithAzureStoragePrefix added in v0.14.0

func WithAzureStoragePrefix(prefix string) AzureStorageOption

WithAzureStoragePrefix configures the azure storage to work under a given prefix.

func WithAzureStorageSignedUrlExpiry added in v0.14.0

func WithAzureStorageSignedUrlExpiry(t time.Duration) AzureStorageOption

WithAzureStorageSignedUrlExpiry configures the duration until the signed url expires

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

func NewCollection

func NewCollection() *Collection

func (*Collection) Add

func (s *Collection) Add(provider *core.Provider)

func (*Collection) List

func (s *Collection) List() *core.ProviderVersions

type GCSStorage

type GCSStorage struct {
	// contains filtered or unexported fields
}

GCSStorage is a Storage implementation backed by GCS. GCSStorage implements module.Storage, provider.Storage, and mirror.Storage

func NewGCSStorage

func NewGCSStorage(bucket string, options ...GCSStorageOption) (*GCSStorage, error)

func (*GCSStorage) GetMirroredProvider

func (s *GCSStorage) GetMirroredProvider(ctx context.Context, provider *core.Provider) (*core.Provider, error)

func (*GCSStorage) GetModule

func (s *GCSStorage) GetModule(ctx context.Context, namespace, name, provider, version string) (core.Module, error)

func (*GCSStorage) GetProvider

func (s *GCSStorage) GetProvider(ctx context.Context, namespace, name, version, os, arch string) (*core.Provider, error)

func (*GCSStorage) ListMirroredProviders

func (s *GCSStorage) ListMirroredProviders(ctx context.Context, provider *core.Provider) ([]*core.Provider, error)

func (*GCSStorage) ListModuleVersions

func (s *GCSStorage) ListModuleVersions(ctx context.Context, namespace, name, provider string) ([]core.Module, error)

func (*GCSStorage) ListProviderVersions

func (s *GCSStorage) ListProviderVersions(ctx context.Context, namespace, name string) (*core.ProviderVersions, error)

func (*GCSStorage) MirroredSha256Sum

func (s *GCSStorage) MirroredSha256Sum(ctx context.Context, provider *core.Provider) (*core.Sha256Sums, error)

func (*GCSStorage) MirroredSigningKeys

func (s *GCSStorage) MirroredSigningKeys(ctx context.Context, hostname, namespace string) (*core.SigningKeys, error)

func (*GCSStorage) SigningKeys

func (s *GCSStorage) SigningKeys(ctx context.Context, namespace string) (*core.SigningKeys, error)

SigningKeys downloads the JSON placed in the namespace in GCS and unmarshals it into a core.SigningKeys

func (*GCSStorage) UploadMirroredFile

func (s *GCSStorage) UploadMirroredFile(ctx context.Context, provider *core.Provider, fileName string, reader io.Reader) error

func (*GCSStorage) UploadMirroredSigningKeys

func (s *GCSStorage) UploadMirroredSigningKeys(ctx context.Context, hostname, namespace string, signingKeys *core.SigningKeys) error

func (*GCSStorage) UploadModule

func (s *GCSStorage) UploadModule(ctx context.Context, namespace, name, provider, version string, body io.Reader) (core.Module, error)

func (*GCSStorage) UploadProviderReleaseFiles

func (s *GCSStorage) UploadProviderReleaseFiles(ctx context.Context, namespace, name, filename string, file io.Reader) error

type GCSStorageOption

type GCSStorageOption func(*GCSStorage)

GCSStorageOption provides additional options for the GCSStorage.

func WithGCSArchiveFormat

func WithGCSArchiveFormat(archiveFormat string) GCSStorageOption

WithGCSArchiveFormat configures the module archive format (zip, tar, tgz, etc.)

func WithGCSServiceAccount

func WithGCSServiceAccount(sa string) GCSStorageOption

WithGCSServiceAccount configures Application Default Credentials (ADC) service account email.

func WithGCSSignedUrlExpiry

func WithGCSSignedUrlExpiry(t time.Duration) GCSStorageOption

WithGCSSignedUrlExpiry configures the duration until the signed url expires

func WithGCSStorageBucketPrefix

func WithGCSStorageBucketPrefix(prefix string) GCSStorageOption

WithGCSStorageBucketPrefix configures the s3 storage to work under a given prefix.

type S3Storage

type S3Storage struct {
	// contains filtered or unexported fields
}

S3Storage is a Storage implementation backed by S3. S3Storage implements module.Storage, provider.Storage, and mirror.Storage

func (*S3Storage) GetMirroredProvider

func (s *S3Storage) GetMirroredProvider(ctx context.Context, provider *core.Provider) (*core.Provider, error)

func (*S3Storage) GetModule

func (s *S3Storage) GetModule(ctx context.Context, namespace, name, provider, version string) (core.Module, error)

GetModule retrieves information about a module from the S3 storage.

func (*S3Storage) GetProvider

func (s *S3Storage) GetProvider(ctx context.Context, namespace, name, version, os, arch string) (*core.Provider, error)

func (*S3Storage) ListMirroredProviders

func (s *S3Storage) ListMirroredProviders(ctx context.Context, provider *core.Provider) ([]*core.Provider, error)

func (*S3Storage) ListModuleVersions

func (s *S3Storage) ListModuleVersions(ctx context.Context, namespace, name, provider string) ([]core.Module, error)

func (*S3Storage) ListProviderVersions

func (s *S3Storage) ListProviderVersions(ctx context.Context, namespace, name string) (*core.ProviderVersions, error)

func (*S3Storage) MirroredSha256Sum

func (s *S3Storage) MirroredSha256Sum(ctx context.Context, provider *core.Provider) (*core.Sha256Sums, error)

func (*S3Storage) MirroredSigningKeys

func (s *S3Storage) MirroredSigningKeys(ctx context.Context, hostname, namespace string) (*core.SigningKeys, error)

func (*S3Storage) SigningKeys

func (s *S3Storage) SigningKeys(ctx context.Context, namespace string) (*core.SigningKeys, error)

SigningKeys downloads the JSON placed in the namespace in S3 and unmarshals it into a core.SigningKeys

func (*S3Storage) UploadMirroredFile

func (s *S3Storage) UploadMirroredFile(ctx context.Context, provider *core.Provider, fileName string, reader io.Reader) error

func (*S3Storage) UploadMirroredSigningKeys

func (s *S3Storage) UploadMirroredSigningKeys(ctx context.Context, hostname, namespace string, signingKeys *core.SigningKeys) error

func (*S3Storage) UploadModule

func (s *S3Storage) UploadModule(ctx context.Context, namespace, name, provider, version string, body io.Reader) (core.Module, error)

UploadModule uploads a module to the S3 storage.

func (*S3Storage) UploadProviderReleaseFiles

func (s *S3Storage) UploadProviderReleaseFiles(ctx context.Context, namespace, name, filename string, file io.Reader) error

type S3StorageOption

type S3StorageOption func(*S3Storage)

S3StorageOption provides additional options for the S3Storage.

func WithS3ArchiveFormat

func WithS3ArchiveFormat(archiveFormat string) S3StorageOption

WithS3ArchiveFormat configures the module archive format (zip, tar, tgz, etc.)

func WithS3StorageBucketEndpoint

func WithS3StorageBucketEndpoint(endpoint string) S3StorageOption

WithS3StorageBucketEndpoint configures the endpoint for a given s3 storage. (needed for MINIO)

func WithS3StorageBucketPrefix

func WithS3StorageBucketPrefix(prefix string) S3StorageOption

WithS3StorageBucketPrefix configures the s3 storage to work under a given prefix.

func WithS3StorageBucketRegion

func WithS3StorageBucketRegion(region string) S3StorageOption

WithS3StorageBucketRegion configures the region for a given s3 storage. TODO: the AWS signing region could be another one as the bucket location

func WithS3StoragePathStyle

func WithS3StoragePathStyle(forcePathStyle bool) S3StorageOption

WithS3StoragePathStyle configures if Path Style is used for a given s3 storage. (needed for MINIO)

func WithS3StorageSignedUrlExpiry

func WithS3StorageSignedUrlExpiry(t time.Duration) S3StorageOption

WithS3StorageSignedUrlExpiry configures the duration until the signed url expires

type Storage

type Storage interface {
	provider.Storage
	module.Storage
	mirror.Storage
}

func NewAzureStorage added in v0.14.0

func NewAzureStorage(account string, container string, options ...AzureStorageOption) (Storage, error)

NewAzureStorage returns a fully initialized Azure Storage.

func NewS3Storage

func NewS3Storage(ctx context.Context, bucket string, options ...S3StorageOption) (Storage, error)

NewS3Storage returns a fully initialized S3 storage.

Jump to

Keyboard shortcuts

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