client

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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
	ReferTo string
	Head    *Commit
	Next    *Commit
}

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 Dial

func Dial(ctx context.Context, port int) (*Client, error)

Dial will attempt to connect to brigd under the specified port

func (*Client) Become

func (cl *Client) Become(who string) error

func (*Client) Cat

func (cl *Client) Cat(path string) (io.ReadCloser, error)

func (*Client) ClearExplicitPins

func (cl *Client) ClearExplicitPins(prefix, from, to string) (int, error)

func (*Client) Close

func (cl *Client) Close() error

Close will close the connection from the client side

func (*Client) ConfigAll

func (cl *Client) ConfigAll() (map[string]string, error)

func (*Client) ConfigGet

func (cl *Client) ConfigGet(key string) (string, error)

func (*Client) ConfigSet

func (cl *Client) ConfigSet(key, value string) error

func (*Client) Connect

func (cl *Client) Connect() error

func (*Client) Copy

func (cl *Client) Copy(srcPath, dstPath string) error

func (*Client) Disconnect

func (cl *Client) Disconnect() error

func (*Client) Exists

func (cl *Client) Exists(path string) (bool, error)

func (*Client) Fetch

func (ctl *Client) Fetch(remote string) error

func (*Client) GarbageCollect

func (cl *Client) GarbageCollect(aggressive bool) ([]*GarbageItem, error)

func (*Client) History

func (cl *Client) History(path string) ([]*Change, error)

func (*Client) Init

func (cl *Client) Init(path, owner, password, backend string) error

func (*Client) List

func (cl *Client) List(root string, maxDepth int) ([]StatInfo, error)

func (*Client) ListExplicitPins

func (cl *Client) ListExplicitPins(prefix, from, to string) ([]ExplicitPin, error)

func (*Client) LocalAddr

func (cl *Client) LocalAddr() net.Addr

Return info about the local addr

func (*Client) Log

func (cl *Client) Log() ([]Commit, error)

func (*Client) MakeCommit

func (cl *Client) MakeCommit(msg string) error

func (*Client) MakeDiff

func (cl *Client) MakeDiff(local, remote, localRev, remoteRev string, needFetch bool) (*Diff, error)

func (*Client) Mkdir

func (cl *Client) Mkdir(path string, createParents bool) error

func (*Client) Mount

func (cl *Client) Mount(mountPath string) error

func (*Client) Move

func (cl *Client) Move(srcPath, dstPath string) error

func (*Client) NetLocate

func (cl *Client) NetLocate(who, mask string, timeoutSec float64) (chan *LocateResult, error)

func (*Client) OnlinePeers

func (cl *Client) OnlinePeers() ([]PeerStatus, error)

func (*Client) Pin

func (cl *Client) Pin(path string) error

func (*Client) Ping

func (cl *Client) Ping() error

func (*Client) Quit

func (cl *Client) Quit() error

Quit sends a quit signal to brigd.

func (*Client) RemoteAdd

func (cl *Client) RemoteAdd(remote Remote) error

func (*Client) RemoteAddr

func (cl *Client) RemoteAddr() net.Addr

Return info about the remote addr

func (*Client) RemoteClear

func (cl *Client) RemoteClear() error

func (*Client) RemoteLs

func (cl *Client) RemoteLs() ([]Remote, error)

func (*Client) RemotePing

func (cl *Client) RemotePing(who string) (float64, error)

func (*Client) RemoteRm

func (cl *Client) RemoteRm(name string) error

func (*Client) RemoteSave

func (cl *Client) RemoteSave(remotes []Remote) error

func (*Client) Remove

func (cl *Client) Remove(path string) error

func (*Client) Reset

func (cl *Client) Reset(path, rev string, force bool) error

func (*Client) SetExplicitPins

func (cl *Client) SetExplicitPins(prefix, from, to string) (int, error)

func (*Client) Stage

func (cl *Client) Stage(localPath, repoPath string) error

func (*Client) StageFromData

func (cl *Client) StageFromData(path string, r io.Reader) error

func (*Client) Stat

func (cl *Client) Stat(path string) (*StatInfo, error)

func (*Client) Sync

func (ctl *Client) Sync(remote string, needFetch bool) error

func (*Client) Tag

func (cl *Client) Tag(rev, name string) error

func (*Client) Touch

func (cl *Client) Touch(path string) error

func (*Client) Unmount

func (cl *Client) Unmount(mountPath string) error

func (*Client) Unpin

func (cl *Client) Unpin(path string) error

func (*Client) Untag

func (cl *Client) Untag(name string) error

func (*Client) Version

func (cl *Client) Version() (*VersionInfo, error)

func (*Client) Whoami

func (cl *Client) Whoami() (*Whoami, error)

type Commit

type Commit struct {
	Hash h.Hash
	Msg  string
	Tags []string
	Date time.Time
}

type Diff

type Diff struct {
	Added   []StatInfo
	Removed []StatInfo
	Ignored []StatInfo
	Missing []StatInfo

	Moved    []DiffPair
	Merged   []DiffPair
	Conflict []DiffPair
}

type DiffPair

type DiffPair struct {
	Src StatInfo
	Dst StatInfo
}

Again: duplicated from catfs/fs.go

type ExplicitPin

type ExplicitPin struct {
	Path   string
	Commit string
}

type GarbageItem

type GarbageItem struct {
	Path    string
	Owner   string
	Content h.Hash
}

type LocateResult

type LocateResult struct {
	Name        string
	Addr        string
	Mask        []string
	Fingerprint string
}

type PeerStatus

type PeerStatus struct {
	Name, Addr string
	LastSeen   time.Time
	Roundtrip  time.Duration
	Err        error
}

type Remote

type Remote struct {
	Name        string         `yaml:"Name"`
	Fingerprint string         `yaml:"Fingerprint"`
	Folders     []RemoteFolder `yaml:"Folders,omitempty,flow"`
}

type RemoteFolder

type RemoteFolder struct {
	Folder string
	Perms  string
}

type StatInfo

type StatInfo struct {
	Path       string
	User       string
	Hash       h.Hash
	Size       uint64
	Inode      uint64
	IsDir      bool
	Depth      int
	ModTime    time.Time
	IsPinned   bool
	IsExplicit bool
	Content    h.Hash
}

type VersionInfo

type VersionInfo struct {
	ServerSemVer  string
	ServerRev     string
	BackendSemVer string
	BackendRev    string
}

type Whoami

type Whoami struct {
	CurrentUser string
	Owner       string
	Fingerprint string
	IsOnline    bool
}

Jump to

Keyboard shortcuts

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