keyhole

package
v0.0.0-...-88e8fcd Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a convenience wrapper on top of RPC to make access a bit more straightforward inside the network manager.

func NewClient

func NewClient(conn string) (*Client, error)

NewClient returns a client ready to go.

func (*Client) ConfigureDevice

func (c *Client) ConfigureDevice(dc InterfaceConfig) (string, error)

ConfigureDevice unsurprisingly configures a device. The configuration supplied should be complete for the desired state, and computations will be done on the server to achieve this state.

func (*Client) InterfaceInfo

func (c *Client) InterfaceInfo(device string) (InterfaceInfo, error)

InterfaceInfo returns information for a given interface.

type InterfaceConfig

type InterfaceConfig struct {
	Name  string
	Peers []Peer
}

InterfaceConfig contains the information needed by keyhole to configure a single interface.

type InterfaceInfo

type InterfaceInfo struct {
	Name        string
	PublicKey   string
	ActivePeers []string
}

InterfaceInfo fully describes an interface in the information that can be publicly shared.

type Keyhole

type Keyhole struct {
	// contains filtered or unexported fields
}

Keyhole is a convenience type to bind server components to.

func New

func New() (*Keyhole, error)

New returns a new keyhole which can accept keys for certain devices.

func (*Keyhole) ConfigureDevice

func (k *Keyhole) ConfigureDevice(dc InterfaceConfig, reply *string) error

ConfigureDevice configues the device with the provided peerlist by computing the difference between the peers that are known and those that must be added or removed.

func (*Keyhole) DeviceInfo

func (k *Keyhole) DeviceInfo(name string, reply *InterfaceInfo) error

DeviceInfo is an RCP method that provides information about the requested device.

func (*Keyhole) DeviceNames

func (k *Keyhole) DeviceNames() []string

DeviceNames returns the device names served by this keyhole server.

func (*Keyhole) Serve

func (k *Keyhole) Serve(bind string, port int) error

Serve serves the keyhole service on a given port and bind.

type Peer

type Peer struct {
	Pubkey     string
	AllowedIPs []string
}

A Peer represents the minimal information needed by keyhole to compute configure a peer for an interface.

Jump to

Keyboard shortcuts

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