Documentation
¶
Index ¶
- Constants
- func NewFileReader(file string, fsEval fseval.FsEval) *fileReader
- type AttrMapper
- type AttrSet
- type DerivedAttrs
- type DeviceAttrs
- type ExpandingWriter
- type FSOptions
- type FileAttrs
- type FileInfo
- type FileSource
- type FileTimes
- type FsNode
- type LazySource
- type NodeAttrs
- type NodeInfo
- type NodeType
- type Readable
- type Source
- type Writer
Constants ¶
View Source
const ( AttrsHash AttrSet = 1 AttrsMtime AttrSet = 2 AttrsAtime AttrSet = 4 AttrsAll = AttrsHash | AttrsMtime | AttrsAtime AttrsCompare = AttrsHash | AttrsMtime TimeFormat = time.RFC3339 )
View Source
const WhiteoutPrefix = ".wh."
TODO: also support opaque whiteout (.wh..wh..opq): https://github.com/opencontainers/image-spec/blob/master/layer.md#opaque-whiteout
Variables ¶
This section is empty.
Functions ¶
func NewFileReader ¶
Types ¶
type AttrMapper ¶
func NewAttrMapper ¶
func NewAttrMapper(idMap idutils.IdMappings) AttrMapper
func NewRootlessAttrMapper ¶
func NewRootlessAttrMapper(idMap idutils.IdMappings) AttrMapper
type DerivedAttrs ¶
func (*DerivedAttrs) Equal ¶
func (s *DerivedAttrs) Equal(o *DerivedAttrs) bool
type DeviceAttrs ¶
type ExpandingWriter ¶
type ExpandingWriter struct {
Writer
}
Writer that expands lazy resources
func (*ExpandingWriter) Lazy ¶
func (w *ExpandingWriter) Lazy(path, name string, src LazySource, written map[Source]string) (err error)
type FSOptions ¶
type FSOptions struct {
Rootless bool
IdMappings idutils.IdMappings
FsEval fseval.FsEval
}
func NewFSOptions ¶
type FileAttrs ¶
type FileAttrs struct {
Mode os.FileMode
idutils.UserIds
Xattrs map[string]string
FileTimes
Size int64
Symlink string
}
func (*FileAttrs) AttrString ¶
type FileInfo ¶
type FileInfo struct {
*FileAttrs
// contains filtered or unexported fields
}
func NewFileInfo ¶
type FileSource ¶
type FsNode ¶
type FsNode interface {
Name() string
Path() string
Empty() bool
SetSource(src Source)
Node(path string) (FsNode, error)
Mkdirs(path string) (FsNode, error)
Link(path, targetPath string) (FsNode, FsNode, error)
AddUpper(path string, src Source) (FsNode, error)
AddLower(path string, src Source) (FsNode, error)
AddWhiteout(path string) (FsNode, error)
Remove()
MockDevices()
Normalized() (FsNode, error)
WriteTo(w io.Writer, attrs AttrSet) error
Write(Writer) error
Diff(FsNode) (FsNode, error)
Hash(AttrSet) (digest.Digest, error)
}
type LazySource ¶
type NodeAttrs ¶
type NodeAttrs struct {
NodeInfo
DerivedAttrs
}
func ParseNodeAttrs ¶
func (*NodeAttrs) AttrString ¶
func (*NodeAttrs) DeriveAttrs ¶
func (s *NodeAttrs) DeriveAttrs() (DerivedAttrs, error)
type NodeInfo ¶
func (*NodeInfo) AttrString ¶
type Readable ¶
type Readable interface {
Reader() (io.ReadCloser, error)
}
func NewReadable ¶
func NewReadableBytes ¶
type Source ¶
type Source interface {
// TODO: a) Replace with CalcDerivedAttrs() and Attrs() returning pointer to all attrs?!
// or at least let DerivedAttrs() return only derived attrs without normal attrs
Attrs() NodeInfo
DeriveAttrs() (DerivedAttrs, error)
Write(dest, name string, w Writer, written map[Source]string) error
}
type Writer ¶
type Writer interface {
Lazy(path, name string, src LazySource, written map[Source]string) error
File(path string, src FileSource) (Source, error)
Link(path, target string) error
Symlink(path string, attrs FileAttrs) error
Dir(path, base string, attrs FileAttrs) error
Mkdir(path string) error
Fifo(path string, attrs DeviceAttrs) error
Device(path string, attrs DeviceAttrs) error
Remove(path string) error
LowerNode(path, name string, a *NodeAttrs) error
LowerLink(path, target string, a *NodeAttrs) error
Parent() error
}
func HashingNilWriter ¶
func HashingNilWriter() Writer
Source Files
¶
Click to show internal directories.
Click to hide internal directories.