networking

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package networking is simple network utility collections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractIp

func ExtractIp(remoteAddr net.Addr) string

func LocalIP

func LocalIP() string

LocalIP returns the non loopback local IP of the host

func ParseIPv4

func ParseIPv4(s []byte) net.IP

Parse IPv4 address (d.d.d.d).

func ResolveIp

func ResolveIp(name string) (net.IP, error)

ResolveIp is resolve a network address from a given hostname with default resolver.

Types

type RoundrobinDialer

type RoundrobinDialer struct {
	Dialer       *net.Dialer
	FallbackHost net.TCPAddr
}

RoundrobinDialer is a wrapper for the DialContext function.

func (*RoundrobinDialer) DialContext

func (d *RoundrobinDialer) DialContext(ctx context.Context, network string, hosts ...string) (net.Conn, error)

DialContext is a connector method with Fail-Over approach.

Jump to

Keyboard shortcuts

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