storage

package
v0.0.0-...-b4648c1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSortedVersions

func GetSortedVersions(storage StorageAdapter, artifactSpec core.ArtifactSpec) ([]*semver.Version, error)

func Tidy

func Tidy(storage StorageAdapter, artifactSpec core.ArtifactSpec, keep int, belowVersion *core.ArtifactVersionSpec) error

Types

type LocalDirectoryAdapter

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

func LocalDirectory

func LocalDirectory() *LocalDirectoryAdapter

func (*LocalDirectoryAdapter) DeleteVersion

func (a *LocalDirectoryAdapter) DeleteVersion(spec core.ArtifactVersionSpec) error

func (*LocalDirectoryAdapter) Download

func (a *LocalDirectoryAdapter) Download(ctx context.Context, spec core.ArtifactVersionSpec, target echo.Context) error

func (*LocalDirectoryAdapter) GetVersions

func (a *LocalDirectoryAdapter) GetVersions(artifactSpec core.ArtifactSpec) ([]*semver.Version, error)

func (*LocalDirectoryAdapter) Upload

func (a *LocalDirectoryAdapter) Upload(ctx context.Context, spec core.ArtifactVersionSpec, echo echo.Context, source io.Reader) error

type MinioAdapter

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

func MinIO

func MinIO() *MinioAdapter

func (*MinioAdapter) DeleteVersion

func (a *MinioAdapter) DeleteVersion(spec core.ArtifactVersionSpec) error

func (*MinioAdapter) Download

func (a *MinioAdapter) Download(ctx context.Context, spec core.ArtifactVersionSpec, target echo.Context) error

func (*MinioAdapter) GetVersions

func (a *MinioAdapter) GetVersions(artifactSpec core.ArtifactSpec) ([]*semver.Version, error)

func (*MinioAdapter) Upload

func (a *MinioAdapter) Upload(ctx context.Context, spec core.ArtifactVersionSpec, target echo.Context, source io.Reader) error

type StorageAdapter

type StorageAdapter interface {
	Upload(ctx context.Context, spec core.ArtifactVersionSpec, target echo.Context, source io.Reader) error
	Download(ctx context.Context, spec core.ArtifactVersionSpec, target echo.Context) error
	GetVersions(artifactSpec core.ArtifactSpec) ([]*semver.Version, error)
	DeleteVersion(spec core.ArtifactVersionSpec) error
}

Jump to

Keyboard shortcuts

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