releasedir

package
v6.4.3-0...-c351b0c Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFinalVersion   = semver.MustNewVersionFromString("1")
	DefaultDevVersion     = semver.MustNewVersionFromString("0+dev.0")
	DefaultDevPostRelease = semver.MustNewVersionSegmentFromString("dev.1")
)

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Path string
	Size int64

	BlobstoreID string
	SHA1        string
}

type BlobSorting

type BlobSorting []Blob

func (BlobSorting) Len

func (s BlobSorting) Len() int

func (BlobSorting) Less

func (s BlobSorting) Less(i, j int) bool

func (BlobSorting) Swap

func (s BlobSorting) Swap(i, j int)

type BlobsDir

type BlobsDir interface {
	Init() error
	Blobs() ([]Blob, error)

	SyncBlobs(numOfParallelWorkers int) error
	UploadBlobs() error

	TrackBlob(string, io.ReadCloser) (Blob, error)
	UntrackBlob(string) error
}

type BlobsDirReporter

type BlobsDirReporter interface {
	BlobDownloadStarted(path string, size int64, blobID, sha1 string)
	BlobDownloadFinished(path, blobID string, err error)

	BlobUploadStarted(path string, size int64, sha1 string)
	BlobUploadFinished(path, blobID string, err error)
}

type Config

type Config interface {
	Name() (string, error)
	SaveName(string) error

	Blobstore() (string, map[string]interface{}, error)
}

type DigestBlobstore

type DigestBlobstore interface {
	Get(blobID string, digest boshcrypto.Digest) (fileName string, err error)
	CleanUp(fileName string) (err error)
	Create(fileName string) (blobID string, digest boshcrypto.MultipleDigest, err error)
	Validate() (err error)
	Delete(blobId string) (err error)
}

type ErrBlobstore

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

ErrBlobstore postpones returning an error until one of the actions are performed.

func NewErrBlobstore

func NewErrBlobstore(err error) ErrBlobstore

func (ErrBlobstore) CleanUp

func (b ErrBlobstore) CleanUp(path string) error

func (ErrBlobstore) Create

func (b ErrBlobstore) Create(path string) (string, crypto.MultipleDigest, error)

func (ErrBlobstore) Delete

func (b ErrBlobstore) Delete(blobID string) error

func (ErrBlobstore) Get

func (b ErrBlobstore) Get(blobID string, digest crypto.Digest) (string, error)

func (ErrBlobstore) Validate

func (b ErrBlobstore) Validate() error

type FSBlobsDir

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

func NewFSBlobsDir

func NewFSBlobsDir(
	dirPath string,
	reporter BlobsDirReporter,
	blobstore boshblob.DigestBlobstore,
	digestCalculator bicrypto.DigestCalculator,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) FSBlobsDir

func (FSBlobsDir) Blobs

func (d FSBlobsDir) Blobs() ([]Blob, error)

func (FSBlobsDir) Init

func (d FSBlobsDir) Init() error

func (FSBlobsDir) SyncBlobs

func (d FSBlobsDir) SyncBlobs(parallel int) error

func (FSBlobsDir) TrackBlob

func (d FSBlobsDir) TrackBlob(path string, src io.ReadCloser) (Blob, error)

func (FSBlobsDir) UntrackBlob

func (d FSBlobsDir) UntrackBlob(path string) error

func (FSBlobsDir) UploadBlobs

func (d FSBlobsDir) UploadBlobs() error

type FSConfig

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

func NewFSConfig

func NewFSConfig(publicPath, privatePath string, fs boshsys.FileSystem) FSConfig

func (FSConfig) Blobstore

func (c FSConfig) Blobstore() (string, map[string]interface{}, error)

func (FSConfig) Name

func (c FSConfig) Name() (string, error)

func (FSConfig) SaveName

func (c FSConfig) SaveName(name string) error

type FSGenerator

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

func NewFSGenerator

func NewFSGenerator(dirPath string, fs boshsys.FileSystem) FSGenerator

func (FSGenerator) GenerateJob

func (g FSGenerator) GenerateJob(name string) error

func (FSGenerator) GeneratePackage

func (g FSGenerator) GeneratePackage(name string) error

type FSGitRepo

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

func NewFSGitRepo

func NewFSGitRepo(dirPath string, runner boshsys.CmdRunner, fs boshsys.FileSystem) FSGitRepo

func (FSGitRepo) Init

func (r FSGitRepo) Init() error

func (FSGitRepo) LastCommitSHA

func (r FSGitRepo) LastCommitSHA() (string, error)

func (FSGitRepo) MustNotBeDirty

func (r FSGitRepo) MustNotBeDirty(force bool) (bool, error)

type FSReleaseDir

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

func NewFSReleaseDir

func NewFSReleaseDir(
	dirPath string,
	config Config,
	gitRepo GitRepo,
	blobsDir BlobsDir,
	generator Generator,
	devReleases ReleaseIndex,
	finalReleases ReleaseIndex,
	finalIndicies boshrel.ArchiveIndicies,
	releaseReader boshrel.Reader,
	timeService clock.Clock,
	fs boshsys.FileSystem,
	parallel int,
) FSReleaseDir

func (FSReleaseDir) BuildRelease

func (d FSReleaseDir) BuildRelease(name string, version semver.Version, force bool) (boshrel.Release, error)

func (FSReleaseDir) DefaultName

func (d FSReleaseDir) DefaultName() (string, error)

func (FSReleaseDir) FinalizeRelease

func (d FSReleaseDir) FinalizeRelease(release boshrel.Release, force bool) error

func (FSReleaseDir) FindRelease

func (d FSReleaseDir) FindRelease(name string, version semver.Version) (boshrel.Release, error)

func (FSReleaseDir) GenerateJob

func (d FSReleaseDir) GenerateJob(name string) error

func (FSReleaseDir) GeneratePackage

func (d FSReleaseDir) GeneratePackage(name string) error

func (FSReleaseDir) Init

func (d FSReleaseDir) Init(git bool) error

func (FSReleaseDir) NextDevVersion

func (d FSReleaseDir) NextDevVersion(name string, timestamp bool) (semver.Version, error)

func (FSReleaseDir) NextFinalVersion

func (d FSReleaseDir) NextFinalVersion(name string) (semver.Version, error)

func (FSReleaseDir) Reset

func (d FSReleaseDir) Reset() error

func (FSReleaseDir) VendorPackage

func (d FSReleaseDir) VendorPackage(pkg *boshpkg.Package) error

type FSReleaseIndex

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

func NewFSReleaseIndex

func NewFSReleaseIndex(
	name string,
	dirPath string,
	reporter ReleaseIndexReporter,
	uuidGen boshuuid.Generator,
	fs boshsys.FileSystem,
) FSReleaseIndex

func (FSReleaseIndex) Add

func (i FSReleaseIndex) Add(manifest boshrelman.Manifest) error

func (FSReleaseIndex) Contains

func (i FSReleaseIndex) Contains(release boshrel.Release) (bool, error)

func (FSReleaseIndex) LastVersion

func (i FSReleaseIndex) LastVersion(name string) (*semver.Version, error)

func (FSReleaseIndex) ManifestPath

func (i FSReleaseIndex) ManifestPath(name, version string) string

type GCSBlobstore

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

func NewGCSBlobstore

func NewGCSBlobstore(
	fs boshsys.FileSystem,
	uuidGen boshuuid.Generator,
	options map[string]interface{},
) GCSBlobstore

func (GCSBlobstore) CleanUp

func (b GCSBlobstore) CleanUp(path string) error

func (GCSBlobstore) Create

func (b GCSBlobstore) Create(path string) (string, error)

func (GCSBlobstore) Delete

func (b GCSBlobstore) Delete(blobID string) error

func (GCSBlobstore) Get

func (b GCSBlobstore) Get(blobID string) (string, error)

func (GCSBlobstore) Validate

func (b GCSBlobstore) Validate() error

type Generator

type Generator interface {
	GenerateJob(string) error
	GeneratePackage(string) error
}

type GitRepo

type GitRepo interface {
	Init() error
	LastCommitSHA() (string, error)
	MustNotBeDirty(force bool) (dirty bool, err error)
}

type Provider

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

func NewProvider

func NewProvider(
	indexReporter boshidx.Reporter,
	releaseIndexReporter ReleaseIndexReporter,
	blobsReporter BlobsDirReporter,
	releaseProvider boshrel.Provider,
	digestCalculator bicrypto.DigestCalculator,
	cmdRunner boshsys.CmdRunner,
	uuidGen boshuuid.Generator,
	timeService clock.Clock,
	fs boshsys.FileSystem,
	digestCreateAlgorithms []boshcrypto.Algorithm,
	logger boshlog.Logger,
) Provider

func (Provider) NewFSBlobsDir

func (p Provider) NewFSBlobsDir(dirPath string) FSBlobsDir

func (Provider) NewFSReleaseDir

func (p Provider) NewFSReleaseDir(dirPath string, parallel int) FSReleaseDir

func (Provider) NewReleaseReader

func (p Provider) NewReleaseReader(dirPath string, parallel int) boshrel.BuiltReader

type ReleaseDir

type ReleaseDir interface {
	Init(bool) error
	Reset() error

	GenerateJob(string) error
	GeneratePackage(string) error

	// DefaultName returns a string for the release.
	DefaultName() (string, error)

	// NextDevVersion and NextFinalVersion returns a next version for the that name.
	// It does not account for gaps and just plainly increments.
	NextDevVersion(name string, timestamp bool) (semver.Version, error)
	NextFinalVersion(name string) (semver.Version, error)

	// FindRelease returns last dev or final release version if it's empty;
	// otherwise it finds a release by given name and version.
	FindRelease(name string, version semver.Version) (boshrel.Release, error)

	// BuildRelease builds a new version of the Release
	// from the release directory by looking at jobs, packages, etc. directories.
	BuildRelease(name string, version semver.Version, force bool) (boshrel.Release, error)
	VendorPackage(*boshpkg.Package) error

	// FinalizeRelease adds the Release to the final list so that it's consumable by others.
	FinalizeRelease(release boshrel.Release, force bool) error
}

type ReleaseIndex

type ReleaseIndex interface {
	LastVersion(name string) (*semver.Version, error)

	Contains(boshrel.Release) (bool, error)
	Add(boshrelman.Manifest) error

	ManifestPath(name, version string) string
}

type ReleaseIndexReporter

type ReleaseIndexReporter interface {
	ReleaseIndexAdded(name, desc string, err error)
}

type S3Blobstore

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

func NewS3Blobstore

func NewS3Blobstore(
	fs boshsys.FileSystem,
	uuidGen boshuuid.Generator,
	options map[string]interface{},
) S3Blobstore

func (S3Blobstore) CleanUp

func (b S3Blobstore) CleanUp(path string) error

func (S3Blobstore) Create

func (b S3Blobstore) Create(path string) (string, error)

func (S3Blobstore) Delete

func (b S3Blobstore) Delete(blobID string) error

func (S3Blobstore) Get

func (b S3Blobstore) Get(blobID string) (string, error)

func (S3Blobstore) Validate

func (b S3Blobstore) Validate() error

Directories

Path Synopsis
indexfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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