fsutil

package
v0.0.0-...-6bf0215 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPatch

func ApplyPatch(dir string, r io.ReadCloser) ([]string, error)

func PatchArchive

func PatchArchive(baseDir string, ops []DiffOp, ignores *ignore.FileIgnores) (io.Reader, int, error)

PatchArchive creates a tarball for given operations in baseDir and returns its size.

Types

type DiffOp

type DiffOp struct {
	Type DiffType
	Path string
}

func FSDiff

func FSDiff(n1, n2 FSNode) []DiffOp

FSDiff returns the operations that needs to be done on n2 to make it look like n1.

func (DiffOp) String

func (o DiffOp) String() string

type DiffType

type DiffType int
const (
	DiffOpAdd DiffType = iota
	DiffOpDel
)

type FSNode

type FSNode struct {
	Name  string      `json:"name"`
	Mode  os.FileMode `json:"mode"`
	Size  int64       `json:"size,omitempty"` // zero for dirs and whiteout files
	Mtime time.Time   `json:"mtime"`          // in UTC, zero time for dirs
	Nodes []FSNode    `json:"nodes,omitempty"`
}

func Walk

func Walk(dir string, rules *ignore.FileIgnores) (FSNode, error)

func (FSNode) RootChecksum

func (f FSNode) RootChecksum() uint64

RootChecksum computes the checksum of the directory through its child nodes. It doesn't take f’s own name, mode, size and mtime into account.

func (FSNode) String

func (f FSNode) String() string

Jump to

Keyboard shortcuts

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