net

package
v0.1.0-alpha.0...-0b1224c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTLSConfig

func DefaultTLSConfig() *tls.Config

DefaultTLSConfig returns a tls.Config object with system default security restrictions

func IsLoopback

func IsLoopback(addr string) bool

IsLoopback returns if and only if the provided address is a loopback address.

func Jitter

func Jitter(dur time.Duration) time.Duration

Jitter returns a random duration in the range dur ±25%.

func LocalOrLets

func LocalOrLets(appName string) (*tls.Config, error)

Types

type Backoff

type Backoff struct {
	// Base is the base duration for waiting between retries.
	Base time.Duration
	// contains filtered or unexported fields
}

Backoff assists in implementing retry loops with exponential backoff and jitter.

func (*Backoff) Next

func (b *Backoff) Next() time.Duration

Next returns the amount of time to wait for the next retry, including exponential backoff and jitter.

type Dialer

type Dialer net.Dialer

Dialer satisfies the interface pq.Dialer

func (*Dialer) Dial

func (d *Dialer) Dial(network, addr string) (net.Conn, error)

Dial connects to the address on the named network.

func (*Dialer) DialTimeout

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

DialTimeout acts like Dial but takes a timeout.

Directories

Path Synopsis
http
httpjson
Package httpjson creates HTTP handlers to map request and response formats onto Go function signatures.
Package httpjson creates HTTP handlers to map request and response formats onto Go function signatures.

Jump to

Keyboard shortcuts

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