Documentation ¶
Index ¶
- type LocateResult
- type RemotesAPI
- func (a *RemotesAPI) Get(name string) (*remotesapi.Remote, error)
- func (a *RemotesAPI) List() ([]*remotesapi.Remote, error)
- func (a *RemotesAPI) MakeDiff(name string) (*catfs.Diff, error)
- func (a *RemotesAPI) OnChange(fn func())
- func (a *RemotesAPI) Remove(name string) error
- func (a *RemotesAPI) Self() (remotesapi.Identity, error)
- func (a *RemotesAPI) Set(rm remotesapi.Remote) error
- func (a *RemotesAPI) Sync(name string) error
- type Server
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocateResult ¶
LocateResult is one entry in the result of the "net locate" command.
type RemotesAPI ¶ added in v0.4.0
type RemotesAPI struct {
// contains filtered or unexported fields
}
RemotesAPI is an adapter of base for the gateway.
func NewRemotesAPI ¶ added in v0.4.0
func NewRemotesAPI(base *base) *RemotesAPI
NewRemotesAPI returns a new RemotesAPI.
func (*RemotesAPI) Get ¶ added in v0.4.0
func (a *RemotesAPI) Get(name string) (*remotesapi.Remote, error)
Get a remote by its `name`.
func (*RemotesAPI) List ¶ added in v0.4.0
func (a *RemotesAPI) List() ([]*remotesapi.Remote, error)
List all existing remotes.
func (*RemotesAPI) MakeDiff ¶ added in v0.4.0
func (a *RemotesAPI) MakeDiff(name string) (*catfs.Diff, error)
MakeDiff produces a diff to the remote with `name`.
func (*RemotesAPI) OnChange ¶ added in v0.4.0
func (a *RemotesAPI) OnChange(fn func())
OnChange register a callback to be called once the remote list changes.
func (*RemotesAPI) Remove ¶ added in v0.4.0
func (a *RemotesAPI) Remove(name string) error
Remove removes a remote by `name`.
func (*RemotesAPI) Self ¶ added in v0.4.0
func (a *RemotesAPI) Self() (remotesapi.Identity, error)
Self returns the identity of this repository.
func (*RemotesAPI) Set ¶ added in v0.4.0
func (a *RemotesAPI) Set(rm remotesapi.Remote) error
Set (i.e. add or modify) a remote. IsAuthenticated, IsOnline and LastSeen will be ignored.
func (*RemotesAPI) Sync ¶ added in v0.4.0
func (a *RemotesAPI) Sync(name string) error
Sync synchronizes the latest state of `name` with our latest state.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the local api server used by the command client.
func BootServer ¶
func BootServer( basePath string, passwordFn func() (string, error), bindHost string, port int, logToStdout bool, ) (*Server, error)
BootServer will boot up the local server. `basePath` is the path to the repository. `passwordFn` is a function that will deliver a password when no password was configured. `bindHost` is the host to bind too. `port` is the port to listen for requests. `logToStdout` should be true when logging to stdout.