Documentation
¶
Index ¶
- func Control(conn syscall.Conn, fn func(fd int) error) error
- func ControlInt(conn syscall.Conn, fn func(fd int) (int, error)) (int, error)
- func Filter(conns []syscall.Conn, ps ...Predicate) ([]syscall.Conn, error)
- func FilterConn(conn syscall.Conn, ps ...Predicate) (keep bool, err error)
- func FilterFd(fd int, ps ...Predicate) (keep bool, err error)
- type Predicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlInt ¶
ControlInt invokes conn.SyscallConn().Control and returns an integer.
func Filter ¶
Filter a list of conns with a list of predicates.
Returns a list of conns for which all predicates returned true.
func FilterConn ¶
Apply a list of predicates to a conn.
Returns true if all predicates return true, false if no predicates were given.
Types ¶
type Predicate ¶
Predicate is a condition for keeping or rejecting a file.
func FirstReuseport ¶
func FirstReuseport() Predicate
FirstReuseport filters out all but the first socket of a reuseport group.
Non-reuseport sockets and non-sockets are ignored.
func IgnoreENOTSOCK ¶
IgnoreENOTSOCK wraps a predicate and returns false instead of unix.ENOTSOCK.
func InetListener ¶
InetListener returns a predicate that keeps listening TCP or connected UDP sockets.
It filters out any files that are not sockets.