ip

package
Version: v0.0.0-...-9a89ba0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NetworkInterfaceToAddrsFunc

func NetworkInterfaceToAddrsFunc(interfaceName string) ([]gonet.Addr, error)

func NewResolver

func NewResolver(ifaceToAddrsFunc InterfaceToAddrsFunc) ipResolver

func NewResolvingInterfaceAddress

func NewResolvingInterfaceAddress(
	interfaceName string,
	ipResolver Resolver,
) *resolvingInterfaceAddress

func NewSimpleInterfaceAddress

func NewSimpleInterfaceAddress(interfaceName string, ip string) simpleInterfaceAddress

Types

type InterfaceAddress

type InterfaceAddress interface {
	GetInterfaceName() string
	// GetIP gets the exposed internet protocol address of the above interface
	GetIP() (string, error)
}

type InterfaceToAddrsFunc

type InterfaceToAddrsFunc func(string) ([]gonet.Addr, error)

type Resolver

type Resolver interface {
	// GetPrimaryIPv4 always returns error unless IPNet is found for given interface
	GetPrimaryIPv4(interfaceName string) (*gonet.IPNet, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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