webui

package
v0.0.0-...-0ace8a3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ctx context.Context, backend *Backend) (http.Handler, error)

NewHandler returns a new http.Handler serving the web ui and communicating with 'backend'.

Types

type Backend

type Backend struct {
	IpNetworkCaps                    chan capnp.Pointer
	GetServerConfig, SetServerConfig chan ServerConfig
	ClientConns                      chan io.ReadWriteCloser
	HaveNetwork                      chan bool
}

A Backend is an interface for communication between the UI and the backend.

type ServerConfig

type ServerConfig struct {
	Host string // Hostname of the server
	Port uint16 // TCP port number
	TLS  bool   // Whether to connect via TLS
}

A ServerConfig specifies a server to connect to.

func (*ServerConfig) String

func (s *ServerConfig) String() string

type SettingsForm

type SettingsForm struct {
	Config    ServerConfig
	XSRFToken string
}

A SettingsForm a set of values for the "settings" form on the web ui.

func (*SettingsForm) Validate

func (form *SettingsForm) Validate(xsrfKey string) error

Validate the SettingsForm. This both sanity-checks the ServerConfig and verifies the XSRF token.

Jump to

Keyboard shortcuts

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