netutil

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: BSD-2-Clause, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package netutil provides network related errors and helper functions.

Index

Constants

View Source
const DefaultDialPort = "5705"

DefaultDialPort is the default port which the API is contacted on.

Variables

This section is empty.

Functions

func AddressesFromNodes

func AddressesFromNodes(nodes []string) ([]string, error)

AddressesFromNodes takes a list of node hosts and attempts to return a list of hosts in host:port format along with any error encountered.

The function accepts node hosts in URL, ip, ip:port, resolvable-name and resolvable-name:port formats and will append the default port value if needed. For hosts where the scheme has been omitted, the scheme for the first host will be used. If the first host has no scheme, it will default to http.

func ErrAllFailed

func ErrAllFailed(addrs []string) error

ErrAllFailed produces a typed StorageOS error which should be used to indicate that the API is not contactable for all of the supplied node addresses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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