releasedir

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFinalVersion   = semver.MustNewVersionFromString("0")
	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)

	DownloadBlobs() 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 {
	FinalName() (string, error)
	SaveFinalName(string) error

	Blobstore() (string, map[string]interface{}, 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, string, error)

func (ErrBlobstore) Delete

func (b ErrBlobstore) Delete(blobID string) error

func (ErrBlobstore) Get

func (b ErrBlobstore) Get(blobID, sha1 string) (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.Blobstore,
	sha1calc bicrypto.SHA1Calculator,
	fs boshsys.FileSystem,
) FSBlobsDir

func (FSBlobsDir) Blobs

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

func (FSBlobsDir) DownloadBlobs

func (d FSBlobsDir) DownloadBlobs() error

func (FSBlobsDir) Init

func (d FSBlobsDir) Init() 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) FinalName

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

func (FSConfig) SaveFinalName

func (c FSConfig) SaveFinalName(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,
	releaseArchiveWriter boshrel.Writer,
	fs boshsys.FileSystem,
) FSReleaseDir

func (FSReleaseDir) BuildRelease

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

func (FSReleaseDir) BuildReleaseArchive

func (d FSReleaseDir) BuildReleaseArchive(release boshrel.Release) (string, 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) 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) LastRelease

func (d FSReleaseDir) LastRelease() (boshrel.Release, 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

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) ArchivePath

func (i FSReleaseIndex) ArchivePath(release boshrel.Release) (string, 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 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,
	sha1calc bicrypto.SHA1Calculator,
	cmdRunner boshsys.CmdRunner,
	uuidGen boshuuid.Generator,
	fs boshsys.FileSystem,
	logger boshlog.Logger,
) Provider

func (Provider) NewFSBlobsDir

func (p Provider) NewFSBlobsDir(dirPath string) FSBlobsDir

func (Provider) NewFSReleaseDir

func (p Provider) NewFSReleaseDir(dirPath string) FSReleaseDir

func (Provider) NewReleaseReader

func (p Provider) NewReleaseReader(dirPath string) 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)

	// LastRelease returns last dev or final release from the release directory.
	LastRelease() (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)

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

	// BuildReleaseArchive does not care about current state of the release directory.
	BuildReleaseArchive(boshrel.Release) (string, 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
	ArchivePath(boshrel.Release) (string, error)
}

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, 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
This file was generated by counterfeiter
This file was generated by counterfeiter
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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