Documentation
¶
Index ¶
- type Change
- type Client
- func (ctl *Client) Become(who string) error
- func (cl *Client) Cat(path string, offline bool) (io.ReadCloser, 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 (ctl *Client) DebugProfilePort() (int, error)
- func (cl *Client) DeletedNodes(root string) ([]StatInfo, 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) GatewayUserAdd(name, password string, folders, rights []string) error
- func (ctl *Client) GatewayUserList() ([]GatewayUser, error)
- func (ctl *Client) GatewayUserRemove(name string) error
- func (ctl *Client) History(path string) ([]*Change, error)
- func (cl *Client) IsCached(path string) (bool, error)
- func (cl *Client) List(root string, maxDepth int) ([]StatInfo, 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) Pin(path string) error
- func (ctl *Client) Ping() error
- func (cl *Client) Push(remoteName string, dryRun bool) error
- func (ctl *Client) Quit() error
- func (cl *Client) RemoteAddOrUpdate(remote Remote) error
- func (cl *Client) RemoteAddr() net.Addr
- func (cl *Client) RemoteByName(name string) (Remote, error)
- func (cl *Client) RemoteClear() error
- func (cl *Client) RemoteLs() ([]Remote, error)
- func (cl *Client) RemoteOnlineList() ([]RemoteStatus, 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 (cl *Client) Repin(root string) error
- func (ctl *Client) Reset(path, rev string, force bool) 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, offline bool) (io.ReadCloser, error)
- func (cl *Client) Touch(path string) error
- func (cl *Client) Undelete(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 (cl *Client) Whoami() (*Whoami, error)
- type Commit
- type ConfigEntry
- type Diff
- type DiffPair
- type FsTabEntry
- type GarbageItem
- type GatewayUser
- type LocateResult
- type MountOptions
- type Remote
- type RemoteFolder
- type RemoteStatus
- 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) 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) DebugProfilePort ¶ added in v0.4.0
DebugProfilePort will get the port of pprof server in the backend. The port changes during daemon restarts.
func (*Client) DeletedNodes ¶ added in v0.4.0
DeletedNodes returns a list of deleted nodes under `root`.
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) GatewayUserAdd ¶ added in v0.4.0
GatewayUserAdd adds a new user to the user database. `folders` is a list of directories he may access. It might be empty, in which case he can access everything (same as []string{"/"})
func (*Client) GatewayUserList ¶ added in v0.4.0
func (ctl *Client) GatewayUserList() ([]GatewayUser, error)
GatewayUserList lists all currently existing users.
func (*Client) GatewayUserRemove ¶ added in v0.4.0
GatewayUserRemove removes an existing user and will error out if the said user does not exist.
func (*Client) History ¶
History returns a detailed set of changes that happened to the node at `path`.
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) Push ¶ added in v0.4.0
Push sets a push request to `remoteName`. If `dryRun` is true, the push won't be send but we will still check if the push is allowed.
func (*Client) RemoteAddOrUpdate ¶ added in v0.4.0
RemoteAddOrUpdate adds a new remote described in `remote`. We thus authenticate this remote.
func (*Client) RemoteAddr ¶
RemoteAddr return info about the remote addr
func (*Client) RemoteByName ¶ added in v0.4.0
RemoteByName adds a new remote described in `remote`. We thus authenticate this remote.
func (*Client) RemoteClear ¶
RemoteClear clears all of the remote list.
func (*Client) RemoteOnlineList ¶ added in v0.4.0
func (cl *Client) RemoteOnlineList() ([]RemoteStatus, error)
RemoteOnlineList is like RemoteList but also includes IsOnline and Authenticated status.
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) 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
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.
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
type FsTabEntry struct {
Name string
Path string
Root string
Active bool
ReadOnly bool
Offline bool
}
FsTabEntry describes a single entry in the filesystem tab
type GarbageItem ¶
GarbageItem is a single path that was reaped by the garbage collector.
type GatewayUser ¶ added in v0.4.0
type GatewayUser struct {
Name string
PasswordHash string
Salt string
Folders []string
Rights []string
}
GatewayUser is a user that has access to the gateway.
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 Remote ¶
type Remote struct {
Name string `yaml:"Name"`
Fingerprint string `yaml:"Fingerprint"`
Folders []RemoteFolder `yaml:"Folders,flow"`
AutoUpdate bool `yaml:"AutoUpdate"`
ConflictStrategy string `yaml:"ConflictStrategy"`
AcceptPush bool `yaml:"AcceptPush"`
}
Remote describes a single remote in the remote list.
type RemoteFolder ¶
type RemoteFolder struct {
Folder string `yaml:"Folder"`
ReadOnly bool `yaml:"ReadOnly"`
ConflictStrategy string `yaml:"ConflictStrategy"`
}
RemoteFolder is a single folder shared with a remote.
type RemoteStatus ¶ added in v0.4.0
type RemoteStatus struct {
Remote Remote
LastSeen time.Time
Roundtrip time.Duration
Err error
Authenticated bool
}
RemoteStatus is a entry in the remote online list. Fingerprint is not necessarily filled.
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.