Documentation ¶
Index ¶
- func NewRootNode(ctx context.Context, idx *index.Index, fn FragmentsGetter) noder.Noder
- type FragmentsGetter
- type Node
- func (n *Node) Children(ctx context.Context) ([]noder.Noder, error)
- func (n *Node) Hash() []byte
- func (n *Node) HashRaw() plumbing.Hash
- func (n *Node) IsDir() bool
- func (n *Node) IsFragments() bool
- func (n *Node) Mode() filemode.FileMode
- func (n *Node) ModifiedAt() time.Time
- func (n *Node) Name() string
- func (n *Node) NumChildren(ctx context.Context) (int, error)
- func (n *Node) Size() int64
- func (n *Node) Skip() bool
- func (n *Node) String() string
- func (n *Node) TrueMode() filemode.FileMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootNode ¶
NewRootNode returns the root node of a computed tree from a index.Index,
Types ¶
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) Hash ¶
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 ¶
HashRaw: Get the original Hash of Entry. If it is fragments, get the hash of fragments, otherwise get the hash of blob