package tarsum
import "github.com/dotcloud/docker/pkg/tarsum"
Index ¶
- Variables
- type FileInfoSumInterface
- type FileInfoSums
- func (fis FileInfoSums) GetAllFile(name string) FileInfoSums
- func (fis FileInfoSums) GetDuplicatePaths() (dups FileInfoSums)
- func (fis FileInfoSums) GetFile(name string) FileInfoSumInterface
- func (fis FileInfoSums) Len() int
- func (fis FileInfoSums) SortByNames()
- func (fis FileInfoSums) SortByPos()
- func (fis FileInfoSums) SortBySums()
- func (fis FileInfoSums) Swap(i, j int)
- type THash
- type TarSum
- func NewTarSum(r io.Reader, dc bool, v Version) (TarSum, error)
- func NewTarSumHash(r io.Reader, dc bool, v Version, tHash THash) (TarSum, error)
- type Version
Variables ¶
var ( ErrNotVersion = errors.New("string does not include a TarSum Version") ErrVersionNotImplemented = errors.New("TarSum Version is not yet implemented") )
TarSum default is "sha256"
Types ¶
type FileInfoSumInterface ¶
type FileInfoSumInterface interface { // File name Name() string // Checksum of this particular file and its headers Sum() string // Position of file in the tar Pos() int64 }
This info will be accessed through interface so the actual name and sum cannot be medled with
type FileInfoSums ¶
type FileInfoSums []FileInfoSumInterface
func (FileInfoSums) GetAllFile ¶
func (fis FileInfoSums) GetAllFile(name string) FileInfoSums
GetAllFile returns a FileInfoSums with all matching names
func (FileInfoSums) GetDuplicatePaths ¶
func (fis FileInfoSums) GetDuplicatePaths() (dups FileInfoSums)
func (FileInfoSums) GetFile ¶
func (fis FileInfoSums) GetFile(name string) FileInfoSumInterface
GetFile returns the first FileInfoSumInterface with a matching name
func (FileInfoSums) Len ¶
func (fis FileInfoSums) Len() int
func (FileInfoSums) SortByNames ¶
func (fis FileInfoSums) SortByNames()
func (FileInfoSums) SortByPos ¶
func (fis FileInfoSums) SortByPos()
func (FileInfoSums) SortBySums ¶
func (fis FileInfoSums) SortBySums()
func (FileInfoSums) Swap ¶
func (fis FileInfoSums) Swap(i, j int)
type THash ¶
A hash.Hash type generator and its name
func NewTHash ¶
Convenience method for creating a THash
type TarSum ¶
type TarSum interface { io.Reader GetSums() FileInfoSums Sum([]byte) string Version() Version Hash() THash }
TarSum is the generic interface for calculating fixed time checksums of a tar archive
func NewTarSum ¶
NewTarSum creates a new interface for calculating a fixed time checksum of a tar archive.
This is used for calculating checksums of layers of an image, in some cases including the byte payload of the image's json metadata as well, and for calculating the checksums for buildcache.
func NewTarSumHash ¶
Create a new TarSum, providing a THash to use rather than the DefaultTHash
type Version ¶
type Version int
versioning of the TarSum algorithm based on the prefix of the hash used i.e. "tarsum+sha256:e58fcf7418d4390dec8e8fb69d88c06ec07039d651fedd3aa72af9972e7d046b"
const ( // Prefix of "tarsum" Version0 Version = iota // Prefix of "tarsum.dev" // NOTE: this variable will be of an unsettled next-version of the TarSum calculation VersionDev )
func GetVersionFromTarsum ¶
GetVersionFromTarsum returns the Version from the provided string
func GetVersions ¶
func GetVersions() []Version
Get a list of all known tarsum Version
func (Version) String ¶
Source Files ¶
fileinfosums.go tarsum.go versioning.go writercloser.go
- Version
- v1.3.1
- Published
- Oct 30, 2014
- Platform
- js/wasm
- Imports
- 12 packages
- Last checked
- 3 seconds ago –
Tools for package owners.