Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateNonOverlappingIPv4Subnet(existingNetworks []*net.IPNet, prefixLen int) (*net.IPNet, *net.IP, error)
- func GenerateServerIPv6FromIPv4(region Region, network Network, tenantID string, ipv4 net.IP) (net.IP, *net.IPNet, error)
- func GenerateUniqueIPv6() (net.IP, error)
- func IsAgentuityIPv6Prefix(ip net.IP) bool
- type IPv6Address
- type Network
- type Region
Constants ¶
const AetherServiceIP = "fd15:d710:2d:c580:9dc5:aeeb::"
const AgentuityIPV6ULAPrefix = "fd15:d710"
this is the agentuity IPV6 ULA prefix
const AgentuityTenantID = "agentuity"
const CatalystServiceIP = "fd15:d710:25:c500:9dc5:d408::"
const OtelServiceIP = "fd15:d710:2a:68d0:9dc5:2763::"
Variables ¶
var Addresses = map[string]string{
"aether": "fd15:d710:2d:c580:9dc5:aeeb::",
"catalyst": "fd15:d710:25:c500:9dc5:d408::",
"otel": "fd15:d710:2a:68d0:9dc5:2763::",
}
var Services = map[string]string{
"fd15:d710:2d:c580:9dc5:aeeb::": "aether",
"fd15:d710:25:c500:9dc5:d408::": "catalyst",
"fd15:d710:2a:68d0:9dc5:2763::": "otel",
}
Functions ¶
func GenerateNonOverlappingIPv4Subnet ¶ added in v1.0.76
func GenerateNonOverlappingIPv4Subnet(existingNetworks []*net.IPNet, prefixLen int) (*net.IPNet, *net.IP, error)
GenerateNonOverlappingIPv4Subnet generates a non-overlapping ipv4 subnet with the given prefix size within the given range.
func GenerateServerIPv6FromIPv4 ¶ added in v1.0.76
func GenerateServerIPv6FromIPv4(region Region, network Network, tenantID string, ipv4 net.IP) (net.IP, *net.IPNet, error)
GenerateServerIPv6FromIPv4 generates a predictable IPv6 address by encoding the IPv4 address
func GenerateUniqueIPv6 ¶ added in v1.0.76
GenerateUniqueIPv6 generates a unique IPv6 address with the Agentuity prefix
func IsAgentuityIPv6Prefix ¶ added in v1.0.76
IsAgentuityIPv6Prefix checks if the given IP address has the Agentuity prefix
Types ¶
type IPv6Address ¶
type IPv6Address struct {
// Region is the region of the IPv6 address.
Region Region
// Network is the network of the IPv6 address.
Network Network
// TenantID is the tenant ID of the IPv6 address.
TenantID string
// MachineID is the machine ID of the IPv6 address.
MachineID string
// HostID is the host ID of the IPv6 address.
HostID string
// contains filtered or unexported fields
}
func NewIPv6Address ¶
func NewIPv6Address(region Region, network Network, tenantID string, machineID string, hostID string) *IPv6Address
NewIPv6Address creates a new IPv6Address struct with the given parameters. It calculates the IPv6 address based on the provided parameters and stores them in the struct. The struct is returned as a pointer to the IPv6Address type.
func (*IPv6Address) MachineSubnet ¶
func (a *IPv6Address) MachineSubnet() string
MachineSubnet returns the subnet for the machine with a /96 mask.
func (*IPv6Address) MarshalJSON ¶
func (a *IPv6Address) MarshalJSON() ([]byte, error)
func (*IPv6Address) String ¶
func (a *IPv6Address) String() string