Documentation
¶
Index ¶
- func Flatten(m []*MH) (addrs []netip.AddrPort)
- type MH
- func (h *MH) Add(domainsOrIps []string) int
- func (h *MH) Addrs() []netip.AddrPort
- func (h *MH) EqualAddrs(other *MH) bool
- func (h *MH) Len() int
- func (h *MH) Mtime() time.Time
- func (h *MH) Names() []string
- func (h *MH) PreferredAddr() netip.AddrPort
- func (h *MH) PreferredAddrs() []netip.AddrPort
- func (h *MH) Refresh() int
- func (h *MH) Set(domainsOrIps []string) int
- func (h *MH) SoftRefresh() int
- func (h *MH) String() string
- type MHAddOp
- type MHMap
- func (m *MHMap) All() (all []*MH)
- func (m *MHMap) Del(h *MH) (ok bool)
- func (m *MHMap) Get(hostOrIpport string) (h *MH, _ error)
- func (m *MHMap) Len() (n int64)
- func (m *MHMap) MaybeRefresh() (n int64)
- func (m *MHMap) Put(h *MH) (ok bool)
- func (m *MHMap) Refresh() (n int64)
- func (m *MHMap) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MH ¶
type MH struct {
sync.RWMutex // protects names and addrs
// contains filtered or unexported fields
}
MH is a list of hostnames and/or ip addresses for one endpoint.
func (*MH) Add ¶
Add appends to the existing list of IPs, hostnames, and hostname's IPs if resolved.
func (*MH) EqualAddrs ¶
func (*MH) PreferredAddr ¶
prefers v4; see: github.com/WireGuard/wireguard-android/blob/4ba87947a/tunnel/src/main/java/com/wireguard/config/InetEndpoint.java#L97
func (*MH) PreferredAddrs ¶
PreferredAddrs returns the list of IPs per the dialer's preference.
func (*MH) Refresh ¶
Refresh resets the list of IPs, hostnames, and re-resolves the hostname. It returns the total number of IPs, or -1 on error.
func (*MH) SoftRefresh ¶
SoftRefresh appends to the list of IPs, hostnames by re-resolving the hostname. It returns the total number of IPs, or -1 on error.
type MHMap ¶
func (*MHMap) MaybeRefresh ¶
Click to show internal directories.
Click to hide internal directories.