Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PublicNamespace is the name of the public namespace of a node // the public namespace is currently unique for a node so we hardcode its name PublicNamespace = "public" // PublicIface is the name of the interface we create in the public namespace PublicIface = "public" // GatewayNamespace is the name of the gateway namespace of a node GatewayNamespace = "gateway" // DefaultBridge is the name of the default bridge created // by the bootstrap of networkd DefaultBridge = "zos" //PublicBridge name PublicBridge = "br-pub" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPNet ¶
IPNet type
func MustParseIPNet ¶
MustParseIPNet prases iprange, panics if invalid
func NewIPNetFromSchema ¶
NewIPNetFromSchema creates an IPNet from schema.IPRange
func (IPNet) MarshalJSON ¶
MarshalJSON dumps iprange as a string
func (*IPNet) UnmarshalText ¶
UnmarshalText loads IPRange from string
type IfaceInfo ¶
type IfaceInfo struct {
Name string `json:"name"`
Addrs []IPNet `json:"addrs"`
Gateway []net.IP `json:"gateway"`
MacAddress schema.MacAddress `json:"macaddress"`
}
IfaceInfo is the information about network interfaces that the node will publish publicly this is used to be able to configure public side of a node
func NewIfaceInfoFromSchema ¶
NewIfaceInfoFromSchema creates an IfaceInfo from schema type
type Node ¶
type Node struct {
NodeID string `json:"node_id"`
FarmID uint64 `json:"farm_id"`
Ifaces []*IfaceInfo `json:"ifaces"`
PublicConfig *PubIface `json:"public_config"`
ExitNode int `json:"exit_node"`
WGPorts []uint `json:"wg_ports"`
}
Node is the public information about a node
func NewNodeFromSchema ¶
NewNodeFromSchema converts a TfgridNode2 into Node
type PubIface ¶
type PubIface struct {
Master string `json:"master"`
// Type define if we need to use
// the Vlan field or the MacVlan
Type IfaceType `json:"type"`
Vlan int16 `json:"vlan"`
IPv4 IPNet `json:"ipv4"`
IPv6 IPNet `json:"ipv6"`
GW4 net.IP `json:"gw4"`
GW6 net.IP `json:"gw6"`
Version int `json:"version"`
}
PubIface is the configuration of the interface that is connected to the public internet
func (*PubIface) ToSchema ¶
func (p *PubIface) ToSchema() directory.PublicIface
ToSchema converts PubIface to schema type
Click to show internal directories.
Click to hide internal directories.