Documentation ¶
Index ¶
- type Agent
- type OptionFunc
- func WithEndpointAddr(endpointAddr string) OptionFunc
- func WithIPs(ips []string) OptionFunc
- func WithKeepAliveDuration(keepalive time.Duration) OptionFunc
- func WithKubeNode(kubeNode string) OptionFunc
- func WithLabels(labels labels.Set) OptionFunc
- func WithLocalKubeClientConfig(config clientcmd.ClientConfig) OptionFunc
- func WithLogger(ll log.FieldLogger) OptionFunc
- func WithOfferRoutes(offerRoutes []string) OptionFunc
- func WithPeerSelector(peerSelector labels.Selector) OptionFunc
- func WithRegistryKubeClientConfig(config clientcmd.ClientConfig) OptionFunc
- func WithRegistryNamespace(registryNamespace string) OptionFunc
- func WithWireGuardInterfaceOptions(wgIfaceOptions *interfaces.WireGuardInterfaceOptions) OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent creates a WireGuard interface, advertises it in the registry, and manages relationships with its peers.
type OptionFunc ¶
type OptionFunc func(*options) error
OptionFunc describes the function signature for methods which modify the agentOptions.
func WithIPs ¶
func WithIPs(ips []string) OptionFunc
WithIPs sets a list of IP addresses to add to the WireGuard interface.
func WithKeepAliveDuration ¶
func WithKeepAliveDuration(keepalive time.Duration) OptionFunc
WithKeepAliveDuration sets the minimum keep-alive duration which this node should use when communicating with peers.
func WithKubeNode ¶
func WithKubeNode(kubeNode string) OptionFunc
WithKubeNode sets the name of this kubernetes node.
func WithLabels ¶
func WithLabels(labels labels.Set) OptionFunc
WithLabels sets the labels for this peer.
func WithLocalKubeClientConfig ¶
func WithLocalKubeClientConfig(config clientcmd.ClientConfig) OptionFunc
WithLocalKubeClientConfig sets the config for the local kubernetes cluster. This is used to retrieve info about the local node, pod, and services. If no registry kubeconfig is specified, this config will also be used to register this peer and discover others.
func WithLogger ¶
func WithLogger(ll log.FieldLogger) OptionFunc
WithLogger sets a logger on the agent options.
func WithOfferRoutes ¶
func WithOfferRoutes(offerRoutes []string) OptionFunc
WithOfferRoutes sets a list of CIDR style routes which we should offer to peers.
func WithPeerSelector ¶
func WithPeerSelector(peerSelector labels.Selector) OptionFunc
WithPeerSelector is a label selector which sets the list of peers we will add to the WireGuard interface. This can be used to exclude peers we have local connectivty with.
func WithRegistryKubeClientConfig ¶
func WithRegistryKubeClientConfig(config clientcmd.ClientConfig) OptionFunc
WithRegistryKubeClientConfig sets the config for the wgmesh registry, which is used to register this peer and discover others.
func WithRegistryNamespace ¶
func WithRegistryNamespace(registryNamespace string) OptionFunc
WithRegistryNamespace sets the namespace for the registry.
func WithWireGuardInterfaceOptions ¶
func WithWireGuardInterfaceOptions(wgIfaceOptions *interfaces.WireGuardInterfaceOptions) OptionFunc
WithWireGuardInterfaceOptions sets parameters used to create/reuse a WireGuard network interface.