encapsulation

package
v0.0.0-...-f021cd2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encapsulator

type Encapsulator interface {
	CleanUp() error
	Gw(net.IP, net.IP, *net.IPNet) net.IP
	Index() int
	Init(int) error
	Rules([]*net.IPNet) iptables.RuleSet
	Set(*net.IPNet) error
	Strategy() Strategy
}

Encapsulator can: * configure the encapsulation interface; * determine the gateway IP corresponding to a node; * get the encapsulation interface index; * set the interface IP address; * return the required IPTables rules; * return the encapsulation strategy; and * clean up any changes applied to the backend.

func NewCilium

func NewCilium(strategy Strategy) Encapsulator

NewCilium returns an encapsulator that uses Cilium.

func NewFlannel

func NewFlannel(strategy Strategy) Encapsulator

NewFlannel returns an encapsulator that uses Flannel.

func NewIPIP

func NewIPIP(strategy Strategy) Encapsulator

NewIPIP returns an encapsulator that uses IPIP.

type Noop

type Noop Strategy

Noop is an encapsulation that does nothing.

func (Noop) CleanUp

func (n Noop) CleanUp() error

CleanUp will also do nothing.

func (Noop) Gw

func (n Noop) Gw(_ net.IP, _ net.IP, _ *net.IPNet) net.IP

Gw will also do nothing.

func (Noop) Index

func (n Noop) Index() int

Index will also do nothing.

func (Noop) Init

func (n Noop) Init(_ int) error

Init will also do nothing.

func (Noop) Rules

func (n Noop) Rules(_ []*net.IPNet) iptables.RuleSet

Rules will also do nothing.

func (Noop) Set

func (n Noop) Set(_ *net.IPNet) error

Set will also do nothing.

func (Noop) Strategy

func (n Noop) Strategy() Strategy

Strategy will finally do nothing.

type Strategy

type Strategy string

Strategy identifies which packets within a location should be encapsulated.

const (
	// Never indicates that no packets within a location
	// should be encapsulated.
	Never Strategy = "never"
	// CrossSubnet indicates that only packets that
	// traverse subnets within a location should be encapsulated.
	CrossSubnet Strategy = "crosssubnet"
	// Always indicates that all packets within a location
	// should be encapsulated.
	Always Strategy = "always"
)

Jump to

Keyboard shortcuts

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