Documentation ¶
Index ¶
- Constants
- Variables
- func AddCloser(reader io.ReadCloser, closer io.Closer, msg ...string) io.ReadCloserdeprecated
- func ApplyOptions(opts Options, olist ...Option) error
- func BlobAccessForData(mimeType string, data []byte) blobaccess.BlobAccessdeprecated
- func BlobAccessForDataAccess[T blobaccess.DataAccess](digest digest.Digest, size int64, mimeType string, access T) blobaccess.AnnotatedBlobAccess[T]
- func BlobAccessForFile(mimeType string, path string, fss ...vfs.FileSystem) blobaccess.BlobAccessdeprecated
- func BlobAccessForFileWithCloser(closer io.Closer, mimeType string, path string, fss ...vfs.FileSystem) blobaccess.BlobAccessdeprecated
- func BlobAccessForString(mimeType string, data string) blobaccess.BlobAccessdeprecated
- func BlobAccessForTemporaryFile(mime string, temp vfs.File, fss ...vfs.FileSystem) blobaccess.BlobAccessdeprecated
- func BlobAccessForTemporaryFilePath(mime string, temp string, fss ...vfs.FileSystem) blobaccess.BlobAccessdeprecated
- func BlobData(blob blobaccess.DataGetter, err error) ([]byte, error)deprecated
- func BlobReader(blob blobaccess.DataReader, err error) (io.ReadCloser, error)deprecated
- func BlobWithMimeType(mimeType string, blob blobaccess.BlobAccess) blobaccess.BlobAccess
- func Close(closer ...io.Closer) error
- func CopyFileSystem(format FileFormat, srcfs vfs.FileSystem, src string, dstfs vfs.FileSystem, ...) error
- func DataAccessForBytes(data []byte, origin ...string) blobaccess.DataSourcedeprecated
- func DataAccessForFile(fs vfs.FileSystem, path string) blobaccess.DataAccessdeprecated
- func DataAccessForReaderFunction(reader func() (io.ReadCloser, error), origin string) blobaccess.DataAccessdeprecated
- func DataAccessForString(data string, origin ...string) blobaccess.DataSourcedeprecated
- func DefaultedFileSystem(def vfs.FileSystem, fss ...vfs.FileSystem) vfs.FileSystemdeprecated
- func Digest(access blobaccess.DataAccess) (digest.Digest, error)deprecated
- func ErrBlobNotFound(digest digest.Digest) errordeprecated
- func ErrInvalidFileFormat(fmt string) error
- func FileSystem(fss ...vfs.FileSystem) vfs.FileSystemdeprecated
- func GetFormats() []string
- func GetFormatsFor[T any](fileFormats map[FileFormat]T) []string
- func IsErrBlobNotFound(err error) booldeprecated
- func IsRetriableError(err error) bool
- func LimitWriter(w io.Writer, n int64) io.Writer
- func NewDefaultDigestReader(r io.Reader) *iotools.DigestReaderdeprecated
- func NewDefaultDigestWriter(w io.WriteCloser) *iotools.DigestWriterdeprecated
- func NewDigestReaderWith(algorithm digest.Algorithm, r io.Reader) *iotools.DigestReaderdeprecated
- func NewDigestReaderWithHash(hash crypto.Hash, r io.Reader) *iotools.DigestReaderdeprecated
- func NewDigestWriterWith(algorithm digest.Algorithm, w io.WriteCloser) *iotools.DigestWriterdeprecated
- func NewFileBuffer() (*fileBuffer, error)
- func NewOndemandReader(p ReaderProvider) io.ReadCloser
- func NewTempFile(fs vfs.FileSystem, dir string, pattern string) (*blobaccess.TempFile, error)deprecated
- func NopWriteCloser(w io.Writer) io.WriteCloser
- func OnceCloser(c io.Closer, callbacks ...CloserCallback) io.Closer
- func ReadCloser(r io.Reader) io.ReadCloser
- func RetriableError(err error) error
- func RetriableError1[T any](r T, err error) (T, error)
- func RetriableError2[S, T any](s S, r T, err error) (S, T, error)
- func Retry(cnt int, d time.Duration, f func() error) error
- func Retry1[T any](cnt int, d time.Duration, f func() (T, error)) (T, error)
- func Retry2[S, T any](cnt int, d time.Duration, f func() (S, T, error)) (S, T, error)
- func TypeForTypeSpec(t string) string
- func VerifyingReader(r io.ReadCloser, digest digest.Digest) io.ReadCloserdeprecated
- func VerifyingReaderWithHash(r io.ReadCloser, hash crypto.Hash, digest string) io.ReadCloserdeprecated
- type AnnotatedBlobAccess
- type BlobAccess
- type BlobCache
- func CachedAccess(src BlobSource, dst BlobSink, cache BlobCache) (BlobCache, error)
- func NewCascadedBlobCache(parent BlobCache) (BlobCache, error)
- func NewCascadedBlobCacheForCache(parent BlobSource, src BlobCache) (BlobCache, error)
- func NewCascadedBlobCacheForSource(parent BlobSource, src BlobSource) (BlobCache, error)
- func NewDefaultBlobCache(fss ...vfs.FileSystem) (BlobCache, error)
- func NewStaticBlobCache(path string, fss ...vfs.FileSystem) (BlobCache, error)
- func NoRefBlobCache(s BlobCache) BlobCache
- type BlobSink
- type BlobSource
- type Buffer
- type CleanupCache
- type Closer
- type CloserCallback
- type DataAccess
- type DataSource
- type DataWriter
- type DigestReaderdeprecated
- type DigestWriterdeprecated
- type FileFormat
- type LimitedBuffer
- type LimitedWriter
- type NopCloser
- type OnDemandReader
- type Option
- type Options
- type ReaderProvider
- type ResettableReader
- type RootedCache
- type StandardOptions
- func (o *StandardOptions) ApplyOption(options Options) error
- func (o *StandardOptions) Default()
- func (o *StandardOptions) DefaultForPath(path string) error
- func (o *StandardOptions) DefaultFormat(fmt FileFormat)
- func (o *StandardOptions) GetFile() vfs.File
- func (o *StandardOptions) GetFileFormat() *FileFormat
- func (o *StandardOptions) GetPathFileSystem() vfs.FileSystem
- func (o *StandardOptions) GetReader() io.Reader
- func (o *StandardOptions) GetRepresentation() vfs.FileSystem
- func (o *StandardOptions) SetFile(file vfs.File)
- func (o *StandardOptions) SetFileFormat(format FileFormat)
- func (o *StandardOptions) SetPathFileSystem(fs vfs.FileSystem)
- func (o *StandardOptions) SetReader(r io.Reader)
- func (o *StandardOptions) SetRepresentation(fs vfs.FileSystem)
- func (o *StandardOptions) ValidForPath(path string) error
- func (o *StandardOptions) WriterFor(path string, mode vfs.FileMode) (io.WriteCloser, error)
- type StaticAllocatable
- type Writer
Constants ¶
const ( // Deprecated: use blobaccess.KIND_BLOB. KIND_BLOB = blobaccess.KIND_BLOB // Deprecated: use blobaccess.KIND_MEDIATYPE. KIND_MEDIATYPE = blobaccess.KIND_MEDIATYPE )
const ( BLOB_UNKNOWN_SIZE = blobaccess.BLOB_UNKNOWN_SIZE BLOB_UNKNOWN_DIGEST = blobaccess.BLOB_UNKNOWN_DIGEST )
const ACCESS_SUFFIX = ".acc"
ACCESS_SUFFIX is the suffix of an additional blob related file used to track the last access time by its modification time, because Go does not support a platform independent way to access the last access time attribute of a filesystem.
const DESCRIPTOR_LIMIT = int64(8196 * 4)
const KIND_FILEFORMAT = "file format"
Variables ¶
var ( ErrClosed = refmgmt.ErrClosed ErrReadOnly = errors.ErrReadOnly() )
Functions ¶
func AddCloser
deprecated
func AddCloser(reader io.ReadCloser, closer io.Closer, msg ...string) io.ReadCloser
Deprecated: use iotools.BlobData.
func ApplyOptions ¶
ApplyOptions applies the given list options on these options.
func BlobAccessForData
deprecated
func BlobAccessForData(mimeType string, data []byte) blobaccess.BlobAccess
Deprecated: use blobaccess.ForData.
func BlobAccessForDataAccess ¶
func BlobAccessForDataAccess[T blobaccess.DataAccess](digest digest.Digest, size int64, mimeType string, access T) blobaccess.AnnotatedBlobAccess[T]
BlobAccessForDataAccess wraps the general access object into a blob access. It closes the wrapped access, if closed. Deprecated: use blobaccess.ForDataAccess.
func BlobAccessForFile
deprecated
func BlobAccessForFile(mimeType string, path string, fss ...vfs.FileSystem) blobaccess.BlobAccess
Deprecated: use blobaccess.ForFile.
func BlobAccessForFileWithCloser
deprecated
added in
v0.5.0
func BlobAccessForFileWithCloser(closer io.Closer, mimeType string, path string, fss ...vfs.FileSystem) blobaccess.BlobAccess
Deprecated: use blobaccess.ForFileWithCloser.
func BlobAccessForString
deprecated
func BlobAccessForString(mimeType string, data string) blobaccess.BlobAccess
Deprecated: use blobaccess.ForString.
func BlobAccessForTemporaryFile
deprecated
added in
v0.5.0
func BlobAccessForTemporaryFile(mime string, temp vfs.File, fss ...vfs.FileSystem) blobaccess.BlobAccess
Deprecated: use blobaccess.ForTemporaryFile.
func BlobAccessForTemporaryFilePath
deprecated
added in
v0.5.0
func BlobAccessForTemporaryFilePath(mime string, temp string, fss ...vfs.FileSystem) blobaccess.BlobAccess
Deprecated: use blobaccess.ForTemporaryFilePath.
func BlobData
deprecated
func BlobData(blob blobaccess.DataGetter, err error) ([]byte, error)
Deprecated: use blobaccess.BlobData.
func BlobReader
deprecated
func BlobReader(blob blobaccess.DataReader, err error) (io.ReadCloser, error)
Deprecated: use blobaccess.BlobReader.
func BlobWithMimeType ¶
func BlobWithMimeType(mimeType string, blob blobaccess.BlobAccess) blobaccess.BlobAccess
BlobWithMimeType changes the mime type for a blob access by wrapping the given blob access. It does NOT provide a new view for the given blob access, so closing the resulting blob access will directly close the backing blob access. Deprecated: use blobaccess.WithMimeType.
func CopyFileSystem ¶ added in v0.4.1
func CopyFileSystem(format FileFormat, srcfs vfs.FileSystem, src string, dstfs vfs.FileSystem, dst string, perm vfs.FileMode) error
func DataAccessForBytes
deprecated
func DataAccessForBytes(data []byte, origin ...string) blobaccess.DataSource
Deprecated: use blobaccess.DataAccessForBytes.
func DataAccessForFile
deprecated
func DataAccessForFile(fs vfs.FileSystem, path string) blobaccess.DataAccess
Deprecated: use blobaccess.DataAccessForFile.
func DataAccessForReaderFunction
deprecated
added in
v0.3.0
func DataAccessForReaderFunction(reader func() (io.ReadCloser, error), origin string) blobaccess.DataAccess
Deprecated: use blobaccess.DataAccessForReaderFunction.
func DataAccessForString
deprecated
func DataAccessForString(data string, origin ...string) blobaccess.DataSource
Deprecated: use blobaccess.DataAccessForString.
func DefaultedFileSystem
deprecated
func DefaultedFileSystem(def vfs.FileSystem, fss ...vfs.FileSystem) vfs.FileSystem
Deprecated: use utils.DefaultedFileSystem.
func Digest
deprecated
func Digest(access blobaccess.DataAccess) (digest.Digest, error)
Deprecated: use blobaccess.Digest.
func ErrBlobNotFound
deprecated
func ErrBlobNotFound(digest digest.Digest) error
Deprecated: use blobaccess.ErrBlobNotFound.
func ErrInvalidFileFormat ¶
func FileSystem
deprecated
func FileSystem(fss ...vfs.FileSystem) vfs.FileSystem
Deprecated: use utils.FileSystem.
func GetFormats ¶
func GetFormats() []string
func GetFormatsFor ¶
func GetFormatsFor[T any](fileFormats map[FileFormat]T) []string
func IsErrBlobNotFound
deprecated
func IsRetriableError ¶ added in v0.4.1
func LimitWriter ¶
LimitWriter returns a Writer that writes to w but stops with EOF after n bytes. The underlying implementation is a *LimitedWriter.
func NewDefaultDigestReader
deprecated
func NewDefaultDigestReader(r io.Reader) *iotools.DigestReader
Deprecated: use iotools.NewDefaultDigestReader.
func NewDefaultDigestWriter
deprecated
func NewDefaultDigestWriter(w io.WriteCloser) *iotools.DigestWriter
Deprecated: use iotools.NewDefaultDigestWriter.
func NewDigestReaderWith
deprecated
func NewDigestReaderWith(algorithm digest.Algorithm, r io.Reader) *iotools.DigestReader
Deprecated: use iotools.NewDigestReaderWith.
func NewDigestReaderWithHash
deprecated
added in
v0.3.0
func NewDigestWriterWith
deprecated
func NewDigestWriterWith(algorithm digest.Algorithm, w io.WriteCloser) *iotools.DigestWriter
Deprecated: use iotools.NewDigestWriterWith.
func NewFileBuffer ¶
func NewFileBuffer() (*fileBuffer, error)
func NewOndemandReader ¶
func NewOndemandReader(p ReaderProvider) io.ReadCloser
func NewTempFile
deprecated
func NewTempFile(fs vfs.FileSystem, dir string, pattern string) (*blobaccess.TempFile, error)
Deprecated: use blobaccess.NewTempFile.
func NopWriteCloser ¶
func NopWriteCloser(w io.Writer) io.WriteCloser
NopWriteCloser returns a ReadCloser with a no-op Close method wrapping the provided Reader r.
func OnceCloser ¶
func OnceCloser(c io.Closer, callbacks ...CloserCallback) io.Closer
func ReadCloser ¶
func ReadCloser(r io.Reader) io.ReadCloser
func RetriableError ¶ added in v0.4.1
func RetriableError1 ¶ added in v0.4.1
func RetriableError2 ¶ added in v0.4.1
func TypeForTypeSpec ¶ added in v0.5.0
TypeForTypeSpec returns the pure type info provided by a type specification.The format hint is an optional suffix separated by a +.
func VerifyingReader
deprecated
added in
v0.3.0
func VerifyingReader(r io.ReadCloser, digest digest.Digest) io.ReadCloser
Deprecated: use iotools.VerifyingReader.
func VerifyingReaderWithHash
deprecated
added in
v0.3.0
func VerifyingReaderWithHash(r io.ReadCloser, hash crypto.Hash, digest string) io.ReadCloser
Deprecated: use iotools.VerifyingReaderWithHash.
Types ¶
type AnnotatedBlobAccess ¶
type AnnotatedBlobAccess[T blobaccess.DataAccess] interface { blobaccess.BlobAccess Source() T }
AnnotatedBlobAccess provides access to the original underlying data source. Deprecated: use blobaccess.AnnotatedBlobAccess.
type BlobAccess ¶
type BlobAccess = blobaccess.BlobAccess
BlobAccess describes the access to a blob. Deprecated: use blobaccess.BlobAccess.
type BlobCache ¶
type BlobCache interface { BlobSource BlobSink AddData(data blobaccess.DataAccess) (int64, digest.Digest, error) }
func CachedAccess ¶
func CachedAccess(src BlobSource, dst BlobSink, cache BlobCache) (BlobCache, error)
func NewCascadedBlobCache ¶
func NewCascadedBlobCacheForCache ¶
func NewCascadedBlobCacheForCache(parent BlobSource, src BlobCache) (BlobCache, error)
func NewCascadedBlobCacheForSource ¶
func NewCascadedBlobCacheForSource(parent BlobSource, src BlobSource) (BlobCache, error)
func NewDefaultBlobCache ¶
func NewDefaultBlobCache(fss ...vfs.FileSystem) (BlobCache, error)
func NewStaticBlobCache ¶
func NewStaticBlobCache(path string, fss ...vfs.FileSystem) (BlobCache, error)
func NoRefBlobCache ¶
type BlobSink ¶
type BlobSink interface { refmgmt.Allocatable AddBlob(blob blobaccess.BlobAccess) (int64, digest.Digest, error) }
func NoRefBlobSink ¶
type BlobSource ¶
type BlobSource interface { refmgmt.Allocatable GetBlobData(digest digest.Digest) (int64, blobaccess.DataAccess, error) }
func NoRefBlobSource ¶
func NoRefBlobSource(s BlobSource) BlobSource
type CleanupCache ¶ added in v0.3.0
type CleanupCache interface { // Cleanup can be implemented to offer a cache reorg. // It returns the number and size of // - handled entries (cnt, size) // - not handled entries (ncnt, nsize) // - failing entries (fcnt, fsize) Cleanup(p common.Printer, before *time.Time, dryrun bool) (cnt int, ncnt int, fcnt int, size int64, nsize int64, fsize int64, err error) }
type CloserCallback ¶
type CloserCallback func()
type DataAccess ¶
type DataAccess = blobaccess.DataAccess
DataAccess describes the access to sequence of bytes. Deprecated: use blobaccess.DataAccess.
type DataSource ¶
type DataSource = blobaccess.DataSource
DataSource describes some data plus its origin. Deprecated: use blobaccess.DataSource.
type DataWriter ¶
func NewDataAccessWriter ¶
func NewDataAccessWriter(acc blobaccess.DataAccess) DataWriter
func NewReaderWriter ¶ added in v0.3.0
func NewReaderWriter(r io.ReadCloser) DataWriter
func NewWriteAtWriter ¶
func NewWriteAtWriter(at func(w io.WriterAt) error) DataWriter
type DigestReader
deprecated
type DigestReader = iotools.DigestReader
Deprecated: use iotools.DigestReader.
type DigestWriter
deprecated
type DigestWriter = iotools.DigestWriter
Deprecated: use iotools.DigestWriter.
type FileFormat ¶
type FileFormat string
const ( FormatTar FileFormat = "tar" FormatTGZ FileFormat = "tgz" FormatDirectory FileFormat = "directory" FormatNone FileFormat = "" )
func DetectFormat ¶
func DetectFormat(path string, fs vfs.FileSystem) (*FileFormat, error)
func DetectFormatForFile ¶
func DetectFormatForFile(file vfs.File) (*FileFormat, error)
func FileFormatForTypeSpec ¶ added in v0.5.0
func FileFormatForTypeSpec(t string) FileFormat
FileFormatForTypeSpec returns the format hint provided by a type specification.The format hint is an optional suffix separated by a +.
func (FileFormat) ApplyOption ¶
func (o FileFormat) ApplyOption(options Options) error
func (FileFormat) String ¶
func (f FileFormat) String() string
func (FileFormat) Suffix ¶
func (f FileFormat) Suffix() string
type LimitedBuffer ¶
type LimitedBuffer struct { *LimitedWriter // contains filtered or unexported fields }
func LimitBuffer ¶
func LimitBuffer(n int64) *LimitedBuffer
func (*LimitedBuffer) Bytes ¶
func (b *LimitedBuffer) Bytes() []byte
func (*LimitedBuffer) Exceeded ¶
func (b *LimitedBuffer) Exceeded() bool
type LimitedWriter ¶
A LimitedWriter writes to W but limits the amount of data written to just N bytes. Each call to Write updates N to reflect the new amount remaining. Write returns EOF when N <= 0 or when the underlying W returns EOF.
type OnDemandReader ¶
type OnDemandReader struct {
// contains filtered or unexported fields
}
func (*OnDemandReader) Close ¶
func (o *OnDemandReader) Close() error
type Option ¶
Option is the interface to specify different archive options.
func PathFileSystem ¶
func PathFileSystem(fs vfs.FileSystem) Option
PathFileSystem set the evaluation filesystem for the path name.
func RepresentationFileSystem ¶
func RepresentationFileSystem(fs vfs.FileSystem) Option
RepresentationFileSystem set the evaltuation filesystem for the path name.
type Options ¶
type Options interface { Option SetFileFormat(FileFormat) GetFileFormat() *FileFormat SetPathFileSystem(vfs.FileSystem) GetPathFileSystem() vfs.FileSystem SetRepresentation(vfs.FileSystem) GetRepresentation() vfs.FileSystem SetFile(vfs.File) GetFile() vfs.File SetReader(closer io.Reader) GetReader() io.Reader ValidForPath(path string) error WriterFor(path string, mode vfs.FileMode) (io.WriteCloser, error) DefaultFormat(fmt FileFormat) Default() DefaultForPath(path string) error }
type ReaderProvider ¶
type ReaderProvider interface {
Reader() (io.ReadCloser, error)
}
type ResettableReader ¶
type ResettableReader struct {
// contains filtered or unexported fields
}
func NewResettableReader ¶
func NewResettableReader(orig io.ReadCloser, size int64) (*ResettableReader, error)
func (*ResettableReader) Close ¶
func (b *ResettableReader) Close() error
func (*ResettableReader) Reset ¶
func (b *ResettableReader) Reset() (io.ReadCloser, error)
type RootedCache ¶
type RootedCache interface {
Root() (string, vfs.FileSystem)
}
type StandardOptions ¶
type StandardOptions struct { // FilePath is the path of the repository base in the filesystem FileFormat *FileFormat `json:"fileFormat,omitempty"` // FileSystem is the virtual filesystem to evaluate the file path. Default is the OS filesytem // or the filesystem defined as base filesystem for the context // This configuration option is not available for the textual representation of // the repository specification PathFileSystem vfs.FileSystem `json:"-"` // Representation is the virtual filesystem to represent the active repository cache. // This configuration option is not available for the textual representation of // the repository specification Representation vfs.FileSystem `json:"-"` // File is an opened file object to use instead of the path and path filesystem // It should never be closed if given to support temporary files File vfs.File `json:"-"` // Reader provides a one time access to the content (archive content only) // The resulting access is therefore temporary and cannot be written back // to its origin, but to other destinations. // The reader must be closed by the provider. Reader io.Reader `json:"-"` }
func (*StandardOptions) ApplyOption ¶
func (o *StandardOptions) ApplyOption(options Options) error
func (*StandardOptions) Default ¶
func (o *StandardOptions) Default()
func (*StandardOptions) DefaultForPath ¶
func (o *StandardOptions) DefaultForPath(path string) error
func (*StandardOptions) DefaultFormat ¶
func (o *StandardOptions) DefaultFormat(fmt FileFormat)
func (*StandardOptions) GetFile ¶
func (o *StandardOptions) GetFile() vfs.File
func (*StandardOptions) GetFileFormat ¶
func (o *StandardOptions) GetFileFormat() *FileFormat
func (*StandardOptions) GetPathFileSystem ¶
func (o *StandardOptions) GetPathFileSystem() vfs.FileSystem
func (*StandardOptions) GetReader ¶
func (o *StandardOptions) GetReader() io.Reader
func (*StandardOptions) GetRepresentation ¶
func (o *StandardOptions) GetRepresentation() vfs.FileSystem
func (*StandardOptions) SetFile ¶
func (o *StandardOptions) SetFile(file vfs.File)
func (*StandardOptions) SetFileFormat ¶
func (o *StandardOptions) SetFileFormat(format FileFormat)
func (*StandardOptions) SetPathFileSystem ¶
func (o *StandardOptions) SetPathFileSystem(fs vfs.FileSystem)
func (*StandardOptions) SetReader ¶
func (o *StandardOptions) SetReader(r io.Reader)
func (*StandardOptions) SetRepresentation ¶
func (o *StandardOptions) SetRepresentation(fs vfs.FileSystem)
func (*StandardOptions) ValidForPath ¶
func (o *StandardOptions) ValidForPath(path string) error
func (*StandardOptions) WriterFor ¶
func (o *StandardOptions) WriterFor(path string, mode vfs.FileMode) (io.WriteCloser, error)
type StaticAllocatable ¶
type StaticAllocatable struct{}
func (StaticAllocatable) Ref ¶
func (_ StaticAllocatable) Ref() error
func (StaticAllocatable) Unref ¶
func (_ StaticAllocatable) Unref() error