infra

package
v0.0.0-...-db8a2f5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NetworkShapeIslands describes an isolated island topology where only the
	// mesh gateways are on the WAN.
	NetworkShapeIslands = NetworkShape("islands")

	// NetworkShapeDual describes a private/public lan/wan split where the
	// servers/meshGateways can route to all other servers/meshGateways and the
	// clients are isolated.
	NetworkShapeDual = NetworkShape("dual")

	// NetworkShapeFlat describes a flat network where every agent has a single
	// ip address and they all are routable.
	NetworkShapeFlat = NetworkShape("flat")
)
View Source
const (
	ClusterLinkModePeer     = ClusterLinkMode("peer")
	ClusterLinkModeFederate = ClusterLinkMode("federate")
)
View Source
const (
	NodeModeAgent     = NodeMode("agent")
	NodeModeDataplane = NodeMode("dataplane")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Network   string
	IPAddress string
}

type Cluster

type Cluster struct {
	Name    string
	Primary bool

	Index        int
	Servers      int
	Clients      int
	MeshGateways int

	BaseIP    string
	WANBaseIP string
}

type ClusterLinkMode

type ClusterLinkMode string

type Network

type Network struct {
	Name string
	CIDR string
}

func (*Network) DockerName

func (n *Network) DockerName() string

type NetworkShape

type NetworkShape string

func (NetworkShape) GetNetworkName

func (s NetworkShape) GetNetworkName(dc string) string

type Node

type Node struct {
	Kind            NodeKind
	Cluster         string
	Name            string
	Segment         string // may be empty
	Partition       string // will be not empty
	Addresses       []Address
	Service         *Service
	MeshGateway     bool
	UseBuiltinProxy bool
	Index           int
	Canary          bool
	// mesh-gateway only
	MeshGatewayUseDNSWANAddress bool
}

func (*Node) AddLabels

func (n *Node) AddLabels(m map[string]string)

func (*Node) Hostname

func (n *Node) Hostname() string

func (*Node) IsAgent

func (n *Node) IsAgent() bool

func (*Node) IsServer

func (n *Node) IsServer() bool

func (*Node) LocalAddress

func (n *Node) LocalAddress() string

func (*Node) PodName

func (n *Node) PodName() string

func (*Node) PublicAddress

func (n *Node) PublicAddress() string

func (*Node) RunsWorkloads

func (n *Node) RunsWorkloads() bool

func (*Node) TokenName

func (n *Node) TokenName() string

type NodeKind

type NodeKind string
const (
	NodeKindUnknown   NodeKind = ""
	NodeKindServer    NodeKind = "server"
	NodeKindClient    NodeKind = "client"
	NodeKindDataplane NodeKind = "dataplane"
	NodeKindInfra     NodeKind = "infra"
)

type NodeMode

type NodeMode string

type Service

type Service struct {
	ID util.Identifier
	// Name               string
	// Namespace          string // will not be empty
	// Partition          string // will be not empty
	Port               int
	UpstreamID         util.Identifier
	UpstreamPeer       string
	UpstreamDatacenter string
	UpstreamLocalPort  int
	UpstreamExtraHCL   string
	Meta               map[string]string
}

type Topology

type Topology struct {
	NetworkShape NetworkShape
	LinkMode     ClusterLinkMode
	NodeMode     NodeMode
	// contains filtered or unexported fields
}

func CompileTopology

func CompileTopology(cfg *config.Config) (*Topology, error)

CompileTopology creates a Topology based on the provided configuration.

func (*Topology) AddAdditionalPrimaryGateway

func (t *Topology) AddAdditionalPrimaryGateway(addr string)

func (*Topology) AddNetwork

func (t *Topology) AddNetwork(n *Network)

func (*Topology) AddNode

func (t *Topology) AddNode(node *Node)

func (*Topology) Cluster

func (t *Topology) Cluster(name string) *Cluster

func (*Topology) ClusterNodes

func (t *Topology) ClusterNodes(cluster string) []*Node

func (*Topology) Clusters

func (t *Topology) Clusters() []Cluster

func (*Topology) FederateWithGateways

func (t *Topology) FederateWithGateways() bool

func (*Topology) GatewayAddrs

func (t *Topology) GatewayAddrs(cluster string) []string

func (*Topology) LeaderIP

func (t *Topology) LeaderIP(cluster string, wan bool) string

func (*Topology) LinkWithFederation

func (t *Topology) LinkWithFederation() bool

func (*Topology) LinkWithPeering

func (t *Topology) LinkWithPeering() bool

func (*Topology) Networks

func (t *Topology) Networks() []*Network

func (*Topology) Node

func (t *Topology) Node(name string) *Node

func (*Topology) Nodes

func (t *Topology) Nodes() []*Node

func (*Topology) ServerIPs

func (t *Topology) ServerIPs(cluster string) []string

func (*Topology) Walk

func (t *Topology) Walk(f func(n *Node) error) error

func (*Topology) WalkSilent

func (t *Topology) WalkSilent(f func(n *Node))

Jump to

Keyboard shortcuts

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