tree

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDir

func FromDir(rootfs string, rootless bool) (fs.FsNode, error)

func NewFS

func NewFS() fs.FsNode

func ParseFsSpec

func ParseFsSpec(b []byte) (r fs.FsNode, err error)

Types

type FsBuilder

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

func NewFsBuilder

func NewFsBuilder(rootfs fs.FsNode, opts fs.FSOptions) *FsBuilder

func (*FsBuilder) AddAll

func (b *FsBuilder) AddAll(srcfs string, sources []string, dest string, usr *idutils.UserIds)

Copies all files that match the provided glob source pattern. Source tar archives are extracted into dest. Source URLs are also supported. See https://docs.docker.com/engine/reference/builder/#add

func (*FsBuilder) AddFiles

func (b *FsBuilder) AddFiles(srcFile, dest string, usr *idutils.UserIds)

func (*FsBuilder) AddURL

func (b *FsBuilder) AddURL(rawURL, dest string)

func (*FsBuilder) CopyAll

func (b *FsBuilder) CopyAll(srcfs string, sources []string, dest string, usr *idutils.UserIds)

Copies all files that match the provided glob source pattern to dest. See https://docs.docker.com/engine/reference/builder/#copy

func (*FsBuilder) CopyDir

func (b *FsBuilder) CopyDir(srcFile, dest string, usr *idutils.UserIds)

Copies the directory recursively including the directory itself.

func (*FsBuilder) FS

func (b *FsBuilder) FS() (fs.FsNode, error)

func (*FsBuilder) Hash

func (b *FsBuilder) Hash(attrs fs.AttrSet) (d digest.Digest, err error)

func (*FsBuilder) HttpHeaderCache

func (b *FsBuilder) HttpHeaderCache(cache source.HttpHeaderCache)

func (*FsBuilder) Write

func (b *FsBuilder) Write(w fs.Writer) error

type FsNode

type FsNode struct {
	fs.NodeInfo
	// contains filtered or unexported fields
}

func (*FsNode) AddLower

func (f *FsNode) AddLower(path string, src fs.Source) (r fs.FsNode, err error)

func (*FsNode) AddUpper

func (f *FsNode) AddUpper(path string, src fs.Source) (r fs.FsNode, err error)

func (*FsNode) AddWhiteout

func (f *FsNode) AddWhiteout(path string) (fs.FsNode, error)

func (*FsNode) AddWhiteoutNode

func (f *FsNode) AddWhiteoutNode(path string) (r *FsNode, err error)

func (*FsNode) Diff

func (f *FsNode) Diff(o fs.FsNode) (r fs.FsNode, err error)

Returns a file system tree containing only new and changed nodes. Nodes that do not exist in the provided file system are returned as whiteouts. Hardlinks from new to unchanged (upper to lower) nodes are supported by adding hardlinked files to diff as well (to preserve hardlinks and stay compatible with external tar tools when writing diff into tar file).

func (*FsNode) Empty

func (f *FsNode) Empty() bool

func (*FsNode) Equal

func (f *FsNode) Equal(o *FsNode) (bool, error)

func (*FsNode) Hash

func (f *FsNode) Hash(attrs fs.AttrSet) (digest.Digest, error)

Generates the file system's hash including the provided attribute set.

func (f *FsNode) Link(path, target string) (linked fs.FsNode, dest fs.FsNode, err error)

func (*FsNode) Mkdirs

func (f *FsNode) Mkdirs(path string) (r fs.FsNode, err error)

func (*FsNode) MockDevices

func (f *FsNode) MockDevices()

Removes whiteout nodes recursively in all children

func (*FsNode) Name

func (f *FsNode) Name() string

func (*FsNode) Node

func (f *FsNode) Node(path string) (r fs.FsNode, err error)

func (*FsNode) Normalized

func (f *FsNode) Normalized() (fs.FsNode, error)

Returns a new normalized file system tree

func (*FsNode) Parent

func (f *FsNode) Parent() (p *FsNode)

func (*FsNode) Path

func (f *FsNode) Path() (p string)

func (*FsNode) Remove

func (f *FsNode) Remove()

Removes this node

func (*FsNode) RemoveWhiteouts

func (f *FsNode) RemoveWhiteouts()

Removes whiteout nodes recursively in all children

func (*FsNode) Root

func (f *FsNode) Root() (r *FsNode)

func (*FsNode) SetSource

func (f *FsNode) SetSource(src fs.Source)

func (*FsNode) String

func (f *FsNode) String() (p string)

func (*FsNode) Write

func (f *FsNode) Write(w fs.Writer) (err error)

Walks through the tree writing all nodes into the provided Writer.

func (*FsNode) WriteTo

func (f *FsNode) WriteTo(w io.Writer, attrs fs.AttrSet) (err error)

Jump to

Keyboard shortcuts

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