netx

package
v0.0.0-...-3fdcba8 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package netx provides additional libraries that extend some of the behaviors in the net standard package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(net string, addr string) (net.Conn, error)

Dial is like DialTimeout using a default timeout of 1 minute.

func DialContext

func DialContext(ctx context.Context, network string, addr string) (net.Conn, error)

DialContext dials the given addr on the given net type using the configured dial function, with the given context.

func DialTimeout

func DialTimeout(network string, addr string, timeout time.Duration) (net.Conn, error)

DialTimeout dials the given addr on the given net type using the configured dial function, timing out after the given timeout.

func DialUDP

func DialUDP(network string, laddr, raddr *net.UDPAddr) (net.PacketConn, error)

func ListenUDP

func ListenUDP(network string, laddr *net.UDPAddr) (net.PacketConn, error)

func OverrideDial

func OverrideDial(dialFN func(ctx context.Context, net string, addr string) (net.Conn, error))

OverrideDial overrides the global dial function.

func OverrideDialUDP

func OverrideDialUDP(dial func(nnetwork string, laddr, raddr *net.UDPAddr) (net.PacketConn, error))

func OverrideListenUDP

func OverrideListenUDP(listen func(network string, laddr *net.UDPAddr) (net.PacketConn, error))

func OverrideResolve

func OverrideResolve(resolveFN func(net string, addr string) (*net.TCPAddr, error))

OverrideResolve overrides the global resolve function.

func Reset

func Reset()

Reset resets netx to its default settings

func Resolve

func Resolve(network string, addr string) (*net.TCPAddr, error)

Resolve resolves the given tcp address using the configured resolve function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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