meshname

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainFromIP

func DomainFromIP(target *net.IP) string

DomainFromIP derives a meshname subdomain for the authoritative DNS server address

Example
test_ip := net.ParseIP("203:f15a:c323:83aa:cdb0:2e84:56b3:e85c")

fmt.Println(meshname.DomainFromIP(&test_ip))
Output:

aib7cwwdeob2vtnqf2cfnm7ilq

func IPFromDomain

func IPFromDomain(domain *string) (net.IP, error)

IPFromDomain derives authoritative DNS server address from the meshname subdomain

Example
test_subdomain := "aib7cwwdeob2vtnqf2cfnm7ilq"

if ip, err := meshname.IPFromDomain(&test_subdomain); err == nil {
	fmt.Println(ip)
}
Output:

203:f15a:c323:83aa:cdb0:2e84:56b3:e85c

Types

type MeshnameServer

type MeshnameServer struct {
	// contains filtered or unexported fields
}

func New

func New(log *log.Logger, listenAddr string, networks map[string]*net.IPNet, enableMeshIP bool) *MeshnameServer

New is a constructor for MeshnameServer

func (*MeshnameServer) IsStarted

func (s *MeshnameServer) IsStarted() bool

func (*MeshnameServer) Start

func (s *MeshnameServer) Start() error

func (*MeshnameServer) Stop

func (s *MeshnameServer) Stop()

Jump to

Keyboard shortcuts

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