connect

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package connect contains an implementation of the connect subcommand. It is used to connect to the mesh as an ephemeral node. It makes certain assumptions about the local environment. For example, it assumes the local hostname or a random UUID for the local node ID, an in-memory raft store, and to join the cluster as an observer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, opts Options, stopChan chan struct{}) error

Connect connects to the mesh as an ephemeral node. The context is used to cancel the initial join to the cluster. The stopChan is used to stop the node.

Types

type Options

type Options struct {
	// InterfaceName is the name of the wireguard interface to use.
	InterfaceName string
	// ListenPort is the port for wireguard to listen on.
	ListenPort uint16
	// ForceTUN is whether to force the use of a TUN interface.
	ForceTUN bool
	// Modprobe is whether to attempt to load the wireguard kernel module.
	Modprobe bool
	// JoinServer is the address of the join server to use.
	JoinServer string
	// RaftPort is the port to use for the Raft transport.
	RaftPort uint16
	// TLSCertFile is the path to a TLS certificate file to use
	// for mTLS.
	TLSCertFile string
	// TLSKeyFile is the path to a TLS key file to use for mTLS.
	TLSKeyFile string
	// TLSCAFile is the path to a CA file for verifying the join
	// server's certificate
	TLSCAFile string
	// VerifyChainOnly is whether to only verify the join server's
	// certificate chain.
	VerifyChainOnly bool
	// Insecure is whether to not use TLS when joining the cluster.
	// This assumes an insecure raft transport as well.
	Insecure bool
	// NoIPv4 is whether to not use IPv4 when joining the cluster.
	NoIPv4 bool
	// NoIPv6 is whether to not use IPv6 when joining the cluster.
	NoIPv6 bool
	// LocalDNS is whether to start a local MeshDNS server.
	LocalDNS bool
	// LocalDNSPort is the port to use for the local MeshDNS server.
	LocalDNSPort uint16
}

Options are options for configuring the connect command.

Jump to

Keyboard shortcuts

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