netutil

package
v0.0.0-...-10d000d Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2013 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("netutil: connection not found")

Functions

func AddrPairUserid

func AddrPairUserid(local, remote net.Addr) (uid int, err error)

AddrPairUserid returns the local userid who owns the TCP connection given by the local and remote ip:port (lipport and ripport, respectively). Returns ErrNotFound for the error if the TCP connection isn't found.

func ConnUserid

func ConnUserid(conn net.Conn) (uid int, err error)

ConnUserid returns the uid that owns the given localhost connection. The returned error is ErrNotFound if the connection wasn't found.

func HostPortToIP

func HostPortToIP(hostport string) (hostaddr *net.TCPAddr, err error)

This fonction allows parsing of a TCPAddr without resolving names other than localhost. It will return an error instead of resolving.

func Localhost

func Localhost() (net.IP, error)

Localhost returns the first address found when doing a lookup on "localhost".

Types

This section is empty.

Jump to

Keyboard shortcuts

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