index

package
v0.16.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootNode

func NewRootNode(ctx context.Context, idx *index.Index, fn FragmentsGetter) noder.Noder

NewRootNode returns the root node of a computed tree from a index.Index,

Types

type FragmentsGetter

type FragmentsGetter func(ctx context.Context, e *index.Entry) *index.Entry

type Node

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

The Node represents a index.Entry or a directory inferred from the path of all entries. 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 a 36-byte slice, 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.

If the node is computed and not based on a index.Entry the hash is equals to a 36-bytes slices of zero values.

func (*Node) HashRaw

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

HashRaw: Get the original Hash of Entry. If it is fragments, get the hash of fragments, otherwise get the hash of blob

func (*Node) IsDir

func (n *Node) IsDir() bool

func (*Node) IsFragments

func (n *Node) IsFragments() 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) TrueMode

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

Jump to

Keyboard shortcuts

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