Documentation
¶
Index ¶
- Constants
- func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*du.Change, error)
- func Ignore(pth string) bool
- type Bucket
- func (b *Bucket) Close() error
- func (b *Bucket) Diff(ctx context.Context, pth string) (diff []*du.Change, err error)
- func (b *Bucket) Get(ctx context.Context, c cid.Cid) (ipld.Node, error)
- func (b *Bucket) HashFile(pth string) (cid.Cid, error)
- func (b *Bucket) MatchPath(pth string, local, remote cid.Cid) (bool, error)
- func (b *Bucket) RemovePath(ctx context.Context, pth string) error
- func (b *Bucket) Root() (local, remote cid.Cid, err error)
- func (b *Bucket) Save(ctx context.Context) error
- func (b *Bucket) SaveFile(ctx context.Context, pth string, name string) error
- func (b *Bucket) SetCidVersion(v int)
- func (b *Bucket) SetRemotePath(pth string, remote cid.Cid) error
Constants ¶
const (
// PatchExt is used to ignore tmp files during a pull.
PatchExt = ".buckpatch"
)
Variables ¶
This section is empty.
Functions ¶
func Diff ¶ added in v1.0.11
Diff returns a set of changes that transform node 'a' into node 'b'. Modified from https://github.com/ipfs/go-merkledag/blob/master/dagutils/diff.go#L104 It only traverses links in the following cases: 1. two node's links number are greater than 0. 2. both of two nodes are ProtoNode. 3. neither of the nodes is a file node, which contains only unnamed raw blocks Otherwise, it compares the cid and emits a Mod change object.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket tracks a local bucket tree structure.
func (*Bucket) Diff ¶
Diff returns a list of changes that are present in path compared to the bucket.
func (*Bucket) HashFile ¶
HashFile returns the cid of the file at path. This method does not alter the bucket.
func (*Bucket) MatchPath ¶ added in v1.0.9
MatchPath returns whether or not the path exists and has matching local and remote cids.
func (*Bucket) RemovePath ¶ added in v1.0.9
RemovePath removes a local path map from the store.
func (*Bucket) Save ¶ added in v1.0.9
Save saves the bucket as a node describing the file tree at the current path.
func (*Bucket) SaveFile ¶ added in v1.0.9
SaveFile saves the bucket as a node describing a directory containing reader.
func (*Bucket) SetCidVersion ¶ added in v1.0.7
CidVersion returns the configured cid version (0 or 1). The default version is 1.
func (*Bucket) SetRemotePath ¶ added in v1.0.9
SetRemotePath sets or creates a mapping from a local path to a remote cid.