Dust

package module
v0.0.0-...-2ad47a0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: BSD-2-Clause, BSD-3-Clause, BSD-2-Clause, + 1 more Imports: 6 Imported by: 15

README

Overview of Dust for Go

(This is still in an unstable state! It is not suitable for production deployment.)

Using Dust

An application that wishes to use Dust will generally link with the main Dust engine package plus one or more model packages. By convention:

  1. Model codecs are generated as Go code, usually via the programs in ../modelgen. They are placed in a package or packages in the namespace of the client application.
  2. A client application imports all of its model packages for side effects.
  3. The model packages call into the Dust package to register their names at init time.
  4. The client application can then request models by short-string names for establishing connections.

Currently, the only available Dust engine package is in ./v2/engine; its full import path is therefore github.com/blanu/Dust/go/v2/engine.

Server identities in Dust 2

The Dust engine uses ASCII key-value parameters for representing public and private server identity and endpoint configuration information. Keys that have a question mark as the last character are considered optional hints; these may be discarded by software versions or configurations that do not support them, without causing connection failures. Neither a key nor a value may contain newlines. A key may not contain horizontal whitespace or the # character. A value may not begin with horizontal whitespace.

Endpoint configuration parameters used by either side include:

  • m=MODEL-NAME (required): the model name being requested, out of an application-specific set.
  • m.KEY=VALUE: possible model-specific parameters.
  • mtu=DECIMAL: maximum size of datagrams that can be delivered over each Dust connection. The default is 1500.

Parameters given to a client to identify a server also include:

  • p=PUBLIC-KEY (required): the uniform representative of the long-term Curve25519 public key of the server in Base32.
  • n=OPAQUE (required): the 32-octet opaque name of the server in Base32.

Parameters given to a server to identify itself instead include:

  • px!=PRIVATE-KEY (required): the long-term Curve25519 private key of the server in Base32.
  • n=OPAQUE (required): the 32-octet opaque name of the server in Base32.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDustClient

func NewDustClient(serverPublic string, dialer proxy.Dialer) *dustClient

func NewDustServer

func NewDustServer(idPath string) *dustServer

Types

type Config

type Config struct {
	ServerPublic string
}

type Transport

type Transport struct {
	ServerPublic string
	Address      string
	Dialer       proxy.Dialer
}

begin optimizer code

func (Transport) Dial

func (transport Transport) Dial() (net.Conn, error)

Jump to

Keyboard shortcuts

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