networking

package module
v1.0.0 Latest Latest
Warning

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

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

README

networking

GoDoc Go Report

Description

Simple network utility collections.

Requirements

Go 1.5 or above.

Installation

Run the following command to install the package:

go get amuz.es/src/go/networking

Getting Started

TBD

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