resource

package
v0.0.110 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: Apache-2.0 Imports: 10 Imported by: 195

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalChunkSorting

type AdditionalChunkSorting []string

func (AdditionalChunkSorting) Len

func (s AdditionalChunkSorting) Len() int

func (AdditionalChunkSorting) Less

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

func (AdditionalChunkSorting) Swap

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

type Archive

type Archive interface {
	Fingerprint() (string, error)
	Build(expectedFp string) (string, string, error)
}

type ArchiveFunc

type ArchiveFunc func([]File, []File, []string) Archive

type ArchiveImpl

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

func NewArchiveImpl

func NewArchiveImpl(
	files []File,
	prepFiles []File,
	additionalChunks []string,
	releaseDirPath string,
	fingerprinter Fingerprinter,
	compressor boshcmd.Compressor,
	sha1calc bicrypto.SHA1Calculator,
	cmdRunner boshsys.CmdRunner,
	fs boshsys.FileSystem,
) ArchiveImpl

func (ArchiveImpl) Build

func (a ArchiveImpl) Build(expectedFp string) (string, string, error)

func (ArchiveImpl) Fingerprint

func (a ArchiveImpl) Fingerprint() (string, error)

type ArchiveIndex

type ArchiveIndex interface {
	Find(name, fingerprint string) (string, string, error)
	Add(name, fingerprint, path, sha1 string) (string, string, error)
}

type File

type File struct {
	Path    string
	DirPath string

	RelativePath string

	// Fingerprinting options
	UseBasename bool
	ExcludeMode bool
}

func NewFile

func NewFile(path, dirPath string) File

func NewFileUsesBasename

func NewFileUsesBasename(path, dirPath string) File

func (File) WithNewDir

func (f File) WithNewDir(dirPath string) File

type FileRelativePathSorting

type FileRelativePathSorting []File

func (FileRelativePathSorting) Len

func (s FileRelativePathSorting) Len() int

func (FileRelativePathSorting) Less

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

func (FileRelativePathSorting) Swap

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

type Fingerprinter

type Fingerprinter interface {
	Calculate([]File, []string) (string, error)
}

type FingerprinterImpl

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

func NewFingerprinterImpl

func NewFingerprinterImpl(sha1calc bicrypto.SHA1Calculator, fs boshsys.FileSystem) FingerprinterImpl

func (FingerprinterImpl) Calculate

func (f FingerprinterImpl) Calculate(files []File, additionalChunks []string) (string, error)

type Resource

type Resource interface {
	Name() string
	Fingerprint() string

	ArchivePath() string
	ArchiveSHA1() string

	Build(dev, final ArchiveIndex) error
	Finalize(final ArchiveIndex) error
}

type ResourceImpl

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

func NewExistingResource

func NewExistingResource(name, fp, sha1 string) *ResourceImpl

func NewResource

func NewResource(name, fp string, archive Archive) *ResourceImpl

func NewResourceWithBuiltArchive

func NewResourceWithBuiltArchive(name, fp, path, sha1 string) *ResourceImpl

func (*ResourceImpl) ArchivePath

func (r *ResourceImpl) ArchivePath() string

func (*ResourceImpl) ArchiveSHA1

func (r *ResourceImpl) ArchiveSHA1() string

func (*ResourceImpl) Build

func (r *ResourceImpl) Build(devIndex, finalIndex ArchiveIndex) error

func (*ResourceImpl) Finalize

func (r *ResourceImpl) Finalize(finalIndex ArchiveIndex) error

func (*ResourceImpl) Fingerprint

func (r *ResourceImpl) Fingerprint() string

func (*ResourceImpl) Name

func (r *ResourceImpl) Name() string

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter 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