server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: AGPL-3.0 Imports: 40 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocateResult

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

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.

func (*Server) Close

func (sv *Server) Close() error

Close will clean up the listener resources.

func (*Server) Serve

func (sv *Server) Serve() error

Serve blocks until a quit command was send.

type URL added in v0.2.0

type URL struct {
	User string
	Path string
}

URL is a path to a file or directory, that might optionally include a user name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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