local

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
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

func Diff(ctx context.Context, ds ipld.DAGService, a, b ipld.Node) ([]*du.Change, error)

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.

func Ignore

func Ignore(pth string) bool

Ignore returns true if the path contains an ignored file.

Types

type Bucket

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

Bucket tracks a local bucket tree structure.

func NewBucket

func NewBucket(pth string, layout options.Layout) (*Bucket, error)

NewBucket creates a new bucket with the given path.

func (*Bucket) Close added in v1.0.9

func (b *Bucket) Close() error

Close closes the store and blocks service.

func (*Bucket) Diff

func (b *Bucket) Diff(ctx context.Context, pth string) (diff []*du.Change, err error)

Diff returns a list of changes that are present in path compared to the bucket.

func (*Bucket) Get

func (b *Bucket) Get(ctx context.Context, c cid.Cid) (ipld.Node, error)

Get returns the node at cid from the bucket.

func (*Bucket) HashFile

func (b *Bucket) HashFile(pth string) (cid.Cid, error)

HashFile returns the cid of the file at path. This method does not alter the bucket.

func (*Bucket) MatchPath added in v1.0.9

func (b *Bucket) MatchPath(pth string, local, remote cid.Cid) (bool, error)

MatchPath returns whether or not the path exists and has matching local and remote cids.

func (*Bucket) RemovePath added in v1.0.9

func (b *Bucket) RemovePath(ctx context.Context, pth string) error

RemovePath removes a local path map from the store.

func (*Bucket) Root added in v1.0.9

func (b *Bucket) Root() (local, remote cid.Cid, err error)

Root returns the local and remote root cids.

func (*Bucket) Save added in v1.0.9

func (b *Bucket) Save(ctx context.Context) error

Save saves the bucket as a node describing the file tree at the current path.

func (*Bucket) SaveFile added in v1.0.9

func (b *Bucket) SaveFile(ctx context.Context, pth string, name string) error

SaveFile saves the bucket as a node describing a directory containing reader.

func (*Bucket) SetCidVersion added in v1.0.7

func (b *Bucket) SetCidVersion(v int)

CidVersion returns the configured cid version (0 or 1). The default version is 1.

func (*Bucket) SetRemotePath added in v1.0.9

func (b *Bucket) SetRemotePath(pth string, remote cid.Cid) error

SetRemotePath sets or creates a mapping from a local path to a remote cid.

Jump to

Keyboard shortcuts

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