v1alpha1

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ApiVersion = "noisysockets.github.com/v1alpha1"

Variables

This section is empty.

Functions

func GetConfigByKind

func GetConfigByKind(kind string) (types.Config, error)

Types

type Config added in v0.5.0

type Config struct {
	types.TypeMeta `yaml:",inline" mapstructure:",squash"`
	// Name is the optional hostname of this peer.
	Name string `yaml:"name,omitempty" mapstructure:"name,omitempty"`
	// ListenPort is an optional port on which to listen for incoming packets.
	// If not specified, one will be chosen randomly.
	ListenPort uint16 `yaml:"listenPort,omitempty" mapstructure:"listenPort,omitempty"`
	// PrivateKey is the private key for this peer.
	PrivateKey string `yaml:"privateKey" mapstructure:"privateKey"`
	// IPs is a list of IP addresses assigned to this peer.
	IPs []string `yaml:"ips,omitempty" mapstructure:"ips,omitempty"`
	// DNSServers is an optional list of DNS servers to use for host resolution.
	DNSServers []string `yaml:"dnsServers,omitempty" mapstructure:"dnsServers,omitempty"`
	// Peers is a list of known peers to which we can send and receive packets.
	Peers []PeerConfig `yaml:"peers,omitempty" mapstructure:"peers,omitempty"`
}

Config is the configuration for a NoisySockets network. It is analogous to the configuration for a WireGuard interface.

func (Config) GetAPIVersion added in v0.5.0

func (c Config) GetAPIVersion() string

func (Config) GetKind added in v0.5.0

func (c Config) GetKind() string

type PeerConfig added in v0.9.2

type PeerConfig struct {
	// Name is the optional hostname of the peer.
	Name string `yaml:"name,omitempty" mapstructure:"name,omitempty"`
	// PublicKey is the public key of the peer.
	PublicKey string `yaml:"publicKey" mapstructure:"publicKey"`
	// Endpoint is an optional endpoint to which the peer's packets should be sent.
	// If not specified, the peers endpoint will be determined from received packets.
	Endpoint string `yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`
	// IPs is a list of IP addresses assigned to the peer, this is optional for gateways.
	// Traffic with a source IP not in this list will be dropped.
	IPs []string `yaml:"ips,omitempty" mapstructure:"ips,omitempty"`
	// DefaultGateway indicates this peer should be used as the default gateway for traffic.
	DefaultGateway bool `yaml:"defaultGateway,omitempty" mapstructure:"defaultGateway,omitempty"`
}

PeerConfig is the configuration for a known wireguard peer.

Jump to

Keyboard shortcuts

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