Documentation ¶
Index ¶
- Constants
- Variables
- func IPV4Only(ip net.IP) bool
- type Filter
- type NodeConfig
- type NodeInfo
- type Peers
- type Ranges
- type YggServer
- func (s *YggServer) Address() (net.IP, error)
- func (s *YggServer) Ensure(z *zinit.Client, ns string) error
- func (s *YggServer) Gateway() (net.IPNet, error)
- func (s *YggServer) NodeID() (ed25519.PublicKey, error)
- func (s *YggServer) Reload(z *zinit.Client) error
- func (s *YggServer) Restart(z *zinit.Client) error
- func (s *YggServer) Subnet() (net.IPNet, error)
- func (s *YggServer) SubnetFor(b []byte) (net.IPNet, error)
- func (s *YggServer) Tun() string
- type YggdrasilNamespace
Constants ¶
const ( YggListenTCP = 9943 YggListenTLS = 9944 YggListenLinkLocal = 9945 YggIface = "ygg0" )
List of port used by yggdrasil
const (
// YggNSInf inside the namespace
YggNSInf = "nygg6"
)
Variables ¶
var PeerListFallback = Peers{ { Endpoint: "tls://45.147.198.155:6010", Up: true, }, { Endpoint: "tcp://51.15.204.214:12345", Up: true, }, { Endpoint: "tls://51.255.223.60:54232", Up: true, }, }
PeerListFallback is an hardcoded list of public yggdrasil node it is used to have some available peer to connect to when we failed to read the online public peer info
Functions ¶
Types ¶
type Filter ¶ added in v0.5.5
type NodeConfig ¶ added in v0.5.5
type NodeConfig config.NodeConfig
NodeConfig wrapper around yggdrasil node config
func GenerateConfig ¶
func GenerateConfig(privateKey ed25519.PrivateKey) (cfg NodeConfig)
GenerateConfig creates a new yggdrasil configuration and generate the box and signing key from the ed25519 Private key of the node this creates a mapping between a yggdrasil identity and the TFGrid identity
type NodeInfo ¶
type NodeInfo struct { Endpoint string `json:"-"` Up bool `json:"up"` ProtoMinor int `json:"proto_minor"` }
NodeInfo is the know information about an yggdrasil public node
type Peers ¶ added in v0.5.5
type Peers []NodeInfo
Peers is a peers list
func FetchPubYggPeerList ¶ added in v0.5.5
FetchPubYggPeerList download the list of public yggdrasil peer from https://publicpeers.neilalexander.dev/publicnodes.json
type YggServer ¶ added in v0.5.5
type YggServer struct {
// contains filtered or unexported fields
}
YggServer represent a yggdrasil server
func EnsureYggdrasil ¶ added in v0.5.5
func EnsureYggdrasil(ctx context.Context, privateKey ed25519.PrivateKey, ns YggdrasilNamespace) (*YggServer, error)
func NewYggServer ¶ added in v0.5.5
func NewYggServer(cfg *NodeConfig) *YggServer
NewYggServer create a new yggdrasil Server
func (*YggServer) Address ¶ added in v0.5.5
Address return the address in the 200::/7 subnet allocated by yggdrasil
func (*YggServer) Gateway ¶ added in v0.5.5
Gateway return the first IP of the 300::/64 subnet allocated by yggdrasil
type YggdrasilNamespace ¶ added in v0.5.5
type YggdrasilNamespace interface { Name() string // IsIPv4Only checks if namespace has NO public ipv6 on any of its interfaces IsIPv4Only() (bool, error) // GetIPs return a list of all IPv6 inside this namespace. GetIPs() ([]net.IPNet, error) // SetYggIP sets the ygg ipv6 on the nygg6 iterface. SetYggIP(ip net.IPNet, gw net.IP) error }
func NewYggdrasilNamespace ¶ added in v0.5.5
func NewYggdrasilNamespace(ns string) (YggdrasilNamespace, error)