Documentation ¶
Index ¶
- type Change
- type Client
- func (ctl *Client) Become(who string) error
- func (cl *Client) Cat(path string) (io.ReadCloser, error)
- func (cl *Client) ClearExplicitPins(prefix, from, to string) (int, error)
- func (cl *Client) Close() error
- func (ctl *Client) CommitInfo(rev string) (bool, *Commit, error)
- func (ctl *Client) ConfigAll() ([]ConfigEntry, error)
- func (ctl *Client) ConfigDoc(key string) (ConfigEntry, error)
- func (ctl *Client) ConfigGet(key string) (string, error)
- func (ctl *Client) ConfigSet(key, value string) error
- func (cl *Client) Copy(srcPath, dstPath string) error
- func (cl *Client) Exists(path string) (bool, error)
- func (ctl *Client) Fetch(remote string) error
- func (ctl *Client) FsTabList() ([]FsTabEntry, error)
- func (ctl *Client) FstabAdd(mountName, mountPath string, opts MountOptions) error
- func (ctl *Client) FstabApply() error
- func (ctl *Client) FstabRemove(mountName string) error
- func (ctl *Client) FstabUnmountAll() error
- func (ctl *Client) GarbageCollect(aggressive bool) ([]*GarbageItem, error)
- func (ctl *Client) History(path string) ([]*Change, error)
- func (ctl *Client) Init(path, owner, password, backend string) error
- func (cl *Client) List(root string, maxDepth int) ([]StatInfo, error)
- func (cl *Client) ListExplicitPins(prefix, from, to string) ([]PathAtCommit, error)
- func (cl *Client) LocalAddr() net.Addr
- func (ctl *Client) Log() ([]Commit, error)
- func (ctl *Client) MakeCommit(msg string) error
- func (ctl *Client) MakeDiff(local, remote, localRev, remoteRev string, needFetch bool) (*Diff, error)
- func (cl *Client) Mkdir(path string, createParents bool) error
- func (ctl *Client) Mount(mountPath string, opts MountOptions) error
- func (cl *Client) Move(srcPath, dstPath string) error
- func (cl *Client) NetConnect() error
- func (cl *Client) NetDisconnect() error
- func (cl *Client) NetLocate(who, mask string, timeoutSec float64) (chan *LocateResult, error)
- func (cl *Client) OnlinePeers() ([]PeerStatus, error)
- func (cl *Client) Pin(path string) error
- func (ctl *Client) Ping() error
- func (ctl *Client) Quit() error
- func (cl *Client) RemoteAdd(remote Remote) error
- func (cl *Client) RemoteAddr() net.Addr
- func (cl *Client) RemoteClear() error
- func (cl *Client) RemoteLs() ([]Remote, error)
- func (cl *Client) RemotePing(who string) (float64, error)
- func (cl *Client) RemoteRm(name string) error
- func (cl *Client) RemoteSave(remotes []Remote) error
- func (cl *Client) RemoteUpdate(remote Remote) error
- func (cl *Client) Remove(path string) error
- func (ctl *Client) Reset(path, rev string, force bool) error
- func (cl *Client) SetExplicitPins(prefix, from, to string) (int, error)
- func (cl *Client) Stage(localPath, repoPath string) error
- func (cl *Client) StageFromReader(repoPath string, r io.Reader) error
- func (cl *Client) Stat(path string) (*StatInfo, error)
- func (ctl *Client) Sync(remote string, needFetch bool) (*Diff, error)
- func (ctl *Client) Tag(rev, name string) error
- func (cl *Client) Tar(path string) (io.ReadCloser, error)
- func (cl *Client) Touch(path string) error
- func (ctl *Client) Unmount(mountPath string) error
- func (cl *Client) Unpin(path string) error
- func (ctl *Client) Untag(name string) error
- func (ctl *Client) Version() (*VersionInfo, error)
- func (ctl *Client) WaitForInit() error
- func (cl *Client) Whoami() (*Whoami, error)
- type Commit
- type ConfigEntry
- type Diff
- type DiffPair
- type FsTabEntry
- type GarbageItem
- type LocateResult
- type MountOptions
- type PathAtCommit
- type PeerStatus
- type Remote
- type RemoteFolder
- type StatInfo
- type VersionInfo
- type Whoami
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct { Path string Mask []string Head *Commit Next *Commit MovedTo string WasPreviouslyAt string IsPinned bool IsExplicit bool }
Change describes a change of a node between two commits.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a helper API that implements the rpc interface to brig and makes all data easily accessible from Go. Note that this layer is needed, so we could later support other languages.
func (*Client) Cat ¶
func (cl *Client) Cat(path string) (io.ReadCloser, error)
Cat outputs the contents of the node at `path`. The node must be a file.
func (*Client) ClearExplicitPins ¶
ClearExplicitPins clears all explicit pins in the commit range `from` until `to`. The files have to start with `prefix`.
func (*Client) CommitInfo ¶ added in v0.2.0
CommitInfo is like a stat(2) for commits.
func (*Client) ConfigAll ¶
func (ctl *Client) ConfigAll() ([]ConfigEntry, error)
ConfigAll returns all config entries with details.
func (*Client) ConfigDoc ¶
func (ctl *Client) ConfigDoc(key string) (ConfigEntry, error)
ConfigDoc gets the documentation for a single config entry at `key`.
func (*Client) FsTabList ¶ added in v0.2.0
func (ctl *Client) FsTabList() ([]FsTabEntry, error)
FsTabList lists all fs tab entries.
func (*Client) FstabAdd ¶ added in v0.2.0
func (ctl *Client) FstabAdd(mountName, mountPath string, opts MountOptions) error
FstabAdd adds a new mount named `mountName` at `mountPath` with `opts`. The mount will only be created after calling FstabApply.
func (*Client) FstabApply ¶ added in v0.2.0
FstabApply will apply any changes made the filesystem tab. This won't do anything if nothing was changed in the mean time.
func (*Client) FstabRemove ¶ added in v0.2.0
FstabRemove removes a named mount called `mountName`.
func (*Client) FstabUnmountAll ¶ added in v0.2.0
FstabUnmountAll will unmount all currently mounted fstab entries.
func (*Client) GarbageCollect ¶
func (ctl *Client) GarbageCollect(aggressive bool) ([]*GarbageItem, error)
GarbageCollect calls the backend (IPSF) garbage collector and returns the collected items.
func (*Client) History ¶
History returns a detailed set of changes that happened to the node at `path`.
func (*Client) ListExplicitPins ¶
func (cl *Client) ListExplicitPins(prefix, from, to string) ([]PathAtCommit, error)
ListExplicitPins lists all paths at all commits that have an explicit pin in the commit range `from` until `to`. The files have to start with `prefix`.
func (*Client) MakeCommit ¶
MakeCommit creates a new commit from the current staging area. The commit will have the message `msg`.
func (*Client) MakeDiff ¶
func (ctl *Client) MakeDiff(local, remote, localRev, remoteRev string, needFetch bool) (*Diff, error)
MakeDiff creates a diff between the commits at `remoteRev` and `localRev`. If `needFetch` is true, the data is first updated from the remote.
func (*Client) Mkdir ¶
Mkdir creates a new empty directory at `path`, possibly creating intermediate directories if `createParents` is set.
func (*Client) Mount ¶
func (ctl *Client) Mount(mountPath string, opts MountOptions) error
Mount creates a new mount at `mountPath` with `opts`.
func (*Client) NetConnect ¶ added in v0.2.0
NetConnect connects to the ipfs network.
func (*Client) NetDisconnect ¶ added in v0.2.0
NetDisconnect disconnects from the ipfs network.
func (*Client) NetLocate ¶
func (cl *Client) NetLocate(who, mask string, timeoutSec float64) (chan *LocateResult, error)
NetLocate tries to find other remotes by searching of `who` described by `mask`. It will at max. take `timeoutSec` to search. This operation might take some time. The return channel will yield a LocateResult once a new result is available.
func (*Client) OnlinePeers ¶
func (cl *Client) OnlinePeers() ([]PeerStatus, error)
OnlinePeers is like RemoteList but also includes IsOnline and Authenticated status.
func (*Client) RemoteAdd ¶
RemoteAdd adds a new remote described in `remote`. We thus authenticate this remote.
func (*Client) RemoteAddr ¶
RemoteAddr return info about the remote addr
func (*Client) RemoteClear ¶
RemoteClear clears all of the remote list.
func (*Client) RemotePing ¶
RemotePing pings a remote by the name `who`.
func (*Client) RemoteSave ¶
RemoteSave swaps the contents of the remote lists with the contents of `remotes`.
func (*Client) RemoteUpdate ¶ added in v0.2.0
RemoteUpdate Updates the contents of `remote`.
func (*Client) Reset ¶
Reset restores the content of `path` to the state at `rev`. If `force` is true, it will overwrite the staging area if it needs to.
func (*Client) SetExplicitPins ¶
SetExplicitPins creates explicit pins for all files starting with `prefix` in the commit range `from` until `to`.
func (*Client) StageFromReader ¶
StageFromReader will create a new node at `repoPath` from the contents of `r`.
func (*Client) Sync ¶
Sync triggers a sync with the data from `remote`. If `needFetch` is true, the data is first updated from the remote.
func (*Client) Tar ¶ added in v0.2.0
func (cl *Client) Tar(path string) (io.ReadCloser, error)
Tar outputs a tar archive with the contents of `path`. `path` can be either a file or directory.
func (*Client) Version ¶
func (ctl *Client) Version() (*VersionInfo, error)
Version returns version information about the server.
func (*Client) WaitForInit ¶ added in v0.2.0
WaitForInit waits until the server is fully functional.
type ConfigEntry ¶
ConfigEntry is a single entry of the config.
type Diff ¶
type Diff struct { Added []StatInfo Removed []StatInfo Ignored []StatInfo Missing []StatInfo Moved []DiffPair Merged []DiffPair Conflict []DiffPair }
Diff gives a detailed overview over the changes between two commits.
type FsTabEntry ¶ added in v0.2.0
FsTabEntry describes a single entry in the filesystem tab
type GarbageItem ¶
GarbageItem is a single path that was reaped by the garbage collector.
type LocateResult ¶
LocateResult is a result returned by Locate()
type MountOptions ¶ added in v0.2.0
MountOptions holds the possible option for a single mount.
type PathAtCommit ¶ added in v0.2.0
PathAtCommit describes the path to a file at the state of a certain commit.
type PeerStatus ¶
type PeerStatus struct { Name string Fingerprint string LastSeen time.Time Roundtrip time.Duration Err error Authenticated bool }
PeerStatus is a entry in the remote online list. Fingerprint is not necessarily filled.
type Remote ¶
type Remote struct { Name string `yaml:"Name"` Fingerprint string `yaml:"Fingerprint"` Folders []string `yaml:"Folders,flow"` }
Remote describes a single remote in the remote list.
type RemoteFolder ¶
type RemoteFolder struct {
Folder string
}
RemoteFolder describes a folder entry in the remote list. Is is currently only a single folder.
type StatInfo ¶
type StatInfo struct { Path string User string Size uint64 Inode uint64 IsDir bool Depth int ModTime time.Time IsPinned bool IsExplicit bool TreeHash h.Hash ContentHash h.Hash BackendHash h.Hash }
StatInfo gives information about a file or directory similar to the normal stat(2) call on POSIX.