server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: AGPL-3.0 Imports: 36 Imported by: 0

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 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