ipdns

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNS

type DNS struct {
	sync.Mutex

	DNS      string
	Resolver *net.Resolver
	Domain   string
	// contains filtered or unexported fields
}

DNS 表示一个DNS提供者,用于通过DNS查找获取IP地址

func (*DNS) Get

func (s *DNS) Get() (net.IP, net.IP, error)

Get 获取IPv4和IPv6地址

type Prober

type Prober struct {
	StunHost string
	NAT1to1  bool
	// contains filtered or unexported fields
}

Prober IP地址探测器

func NewProber

func NewProber(stun string, nat1to1 bool) (*Prober, error)

NewProber 创建新的IP探测器

func (*Prober) Get

func (p *Prober) Get() (net.IP, net.IP, error)

Get 获取IPv4和IPv6地址

type Provider

type Provider interface {
	// Get 获取IPv4和IPv6地址
	Get() (net.IP, net.IP, error)
}

Provider 定义IP地址提供者接口

type Static

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

Static 静态IP地址提供者

func NewStatic

func NewStatic(ips []string) (*Static, error)

NewStatic 创建新的静态IP地址提供者

func (*Static) Get

func (s *Static) Get() (net.IP, net.IP, error)

Get 获取IPv4和IPv6地址

Jump to

Keyboard shortcuts

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