network

package
v1.0.76 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AetherServiceIP = "fd15:d710:2d:c580:9dc5:aeeb::"
View Source
const AgentuityIPV6ULAPrefix = "fd15:d710"

this is the agentuity IPV6 ULA prefix

View Source
const AgentuityTenantID = "agentuity"
View Source
const CatalystServiceIP = "fd15:d710:25:c500:9dc5:d408::"
View Source
const OtelServiceIP = "fd15:d710:2a:68d0:9dc5:2763::"

Variables

View Source
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::",
}
View Source
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

func GenerateUniqueIPv6() (net.IP, error)

GenerateUniqueIPv6 generates a unique IPv6 address with the Agentuity prefix

func IsAgentuityIPv6Prefix added in v1.0.76

func IsAgentuityIPv6Prefix(ip net.IP) bool

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

type Network

type Network uint8
const (
	NetworkPrivateGravity   Network = 0x00
	NetworkExternalCustomer Network = 0x01
	NetworkPrivateServices  Network = 0x02
	NetworkHadron           Network = 0x03
	NetworkAgent            Network = 0x04
)

type Region

type Region uint8
const (
	RegionGlobal     Region = 0x00
	RegionUSCentral1 Region = 0x01
	RegionUSWest1    Region = 0x02
	RegionUSEast1    Region = 0x03
)

Jump to

Keyboard shortcuts

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