Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultHostsFilePath ¶
func GetDefaultHostsFilePath() string
Types ¶
type HostsFileUplooker ¶
hosts contains known host entries.
func NewHostsFileUplooker ¶
func NewHostsFileUplooker(options ...HostsFileUplookerOptionFunc) (*HostsFileUplooker, error)
func (*HostsFileUplooker) LookupAddr ¶
func (u *HostsFileUplooker) LookupAddr(ctx context.Context, addr string) []string
lookupStaticAddr looks up the hosts for the given address from /etc/hosts.
func (*HostsFileUplooker) LookupHost ¶
lookupStaticHost looks up the addresses and the canonical name for the given host from /etc/hosts.
type HostsFileUplookerOptionFunc ¶
type HostsFileUplookerOptionFunc func(*HostsFileUplooker) error
func WithCacheMaxAge ¶
func WithCacheMaxAge(d time.Duration) HostsFileUplookerOptionFunc
func WithHostsFilePath ¶
func WithHostsFilePath(path string) HostsFileUplookerOptionFunc
func WithNowGetter ¶
func WithNowGetter(f func() time.Time) HostsFileUplookerOptionFunc
Click to show internal directories.
Click to hide internal directories.