Documentation
¶
Index ¶
- Variables
- type Chain
- func (c *Chain) Add(r io.Reader, h hash.Hash) (string, error)
- func (c *Chain) AddInline(w io.Writer, r io.Reader, h hash.Hash) (string, error)
- func (c *Chain) AllSums() []string
- func (c *Chain) FirstMatch(c2 *Chain) (*Chain, error)
- func (c *Chain) LastMatch(c2 *Chain) (*Chain, error)
- func (c *Chain) Sum(h hash.Hash) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoMatch = errors.New("Chains do not match")
)
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain is a chain of sums iconifying generational changes to a single file, so that you can trace the origin of divergence later. Add to the Chain with the Add() function.
func (*Chain) Add ¶
Add a file's sum to the chain. Returns the hex encoded sum for convenience. Always use the same hash.Hash type, but never the same object, with this function.
func (*Chain) AddInline ¶
Same as Add(), but also write it to the writer in the process. The sum is returned along with any error.
func (*Chain) FirstMatch ¶
Find the first match in the provided chain; returns the passed chain that follows the match.
Click to show internal directories.
Click to hide internal directories.