filesystem

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootNode

func NewRootNode(root string, m noder.Matcher) noder.Noder

NewRootNode returns the root node based on a given billy.Filesystem.

In order to provide the submodule hash status, a map[string]plumbing.Hash should be provided where the key is the path of the submodule and the commit of the submodule HEAD

Types

type Node

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

The Node represents a file or a directory in a billy.Filesystem. It implements the interface noder.Noder of merkletrie package.

This implementation implements a "standard" hash method being able to be compared with any other noder.Noder implementation inside of go-git.

func (*Node) Children

func (n *Node) Children(ctx context.Context) ([]noder.Noder, error)

func (*Node) Hash

func (n *Node) Hash() []byte

Hash the hash of a filesystem is the result of concatenating the computed plumbing.Hash of the file as a Blob and its plumbing.FileMode; that way the difftree algorithm will detect changes in the contents of files and also in their mode.

The hash of a directory is always a 36-bytes slice of zero values

func (*Node) HashRaw

func (n *Node) HashRaw() plumbing.Hash

func (*Node) HijackMode added in v0.14.0

func (n *Node) HijackMode(mode filemode.FileMode)

func (*Node) IsDir

func (n *Node) IsDir() bool

func (*Node) Mode

func (n *Node) Mode() filemode.FileMode

func (*Node) ModifiedAt

func (n *Node) ModifiedAt() time.Time

func (*Node) Name

func (n *Node) Name() string

func (*Node) NumChildren

func (n *Node) NumChildren(ctx context.Context) (int, error)

func (*Node) Size

func (n *Node) Size() int64

func (*Node) Skip

func (n *Node) Skip() bool

func (*Node) String

func (n *Node) String() string

func (*Node) Type

func (n *Node) Type() string

Jump to

Keyboard shortcuts

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