netkit

package
v0.0.0-...-ff6a228 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPVersion4 = 4
	IPVersion6 = 6
)
View Source
const (
	MailServerHostExmail = "smtp.exmail.qq.com"
	MailServerHost126    = "smtp.126.com"
	MailServerHost163    = "smtp.163.com"
)
View Source
const (
	DefaultDNSServer = "8.8.8.8:53"
)

Variables

View Source
var (
	DNSTimeout = 3
	DNSRetry   = 3
)

Functions

func GetDomainSuffix

func GetDomainSuffix(name string) string

func GetRootDomain

func GetRootDomain(name string) (string, error)

func QueryDNSCnameRecord

func QueryDNSCnameRecord(domain string) *dns.CNAME

func QueryDNSSRVRecord

func QueryDNSSRVRecord(domain string) *dns.SRV

func SendEmail

func SendEmail(toEmails, subject, content string)

func SetFQDN

func SetFQDN(domain string) string

FQDN: A fully qualified domain name.

func ToDomainWithDot

func ToDomainWithDot(domain string) string

func TrimDomainDot

func TrimDomainDot(domain string) string

Types

type Fetcher

type Fetcher interface {
	Fetch(ipv4, ipv6 bool, asn ...string) (map[string]map[string][]*net.IPNet, error)
}

https://github.com/g0dsCookie/asn2ip https://www.radb.net/query/help

func NewCachedFetcher

func NewCachedFetcher(host string, port int) Fetcher

func NewFetcher

func NewFetcher(host string, port int) Fetcher

type MailUser

type MailUser struct {
	Email string
	Name  string
}

Jump to

Keyboard shortcuts

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