client-go: k8s.io/client-go/util/connrotation Index | Files

package connrotation

import "k8s.io/client-go/util/connrotation"

Package connrotation implements a connection dialer that tracks and can close all created connections.

This is used for credential rotation of long-lived connections, when there's no way to re-authenticate on a live connection.

Index

Package Files

connrotation.go

type DialFunc Uses

type DialFunc func(ctx context.Context, network, address string) (net.Conn, error)

DialFunc is a shorthand for signature of net.DialContext.

type Dialer Uses

type Dialer struct {
    // contains filtered or unexported fields
}

Dialer opens connections through Dial and tracks them.

func NewDialer Uses

func NewDialer(dial DialFunc) *Dialer

NewDialer creates a new Dialer instance.

If dial is not nil, it will be used to create new underlying connections. Otherwise net.DialContext is used.

func (*Dialer) CloseAll Uses

func (d *Dialer) CloseAll()

CloseAll forcibly closes all tracked connections.

Note: new connections may get created before CloseAll returns.

func (*Dialer) Dial Uses

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

Dial creates a new tracked connection.

func (*Dialer) DialContext Uses

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

DialContext creates a new tracked connection.

Package connrotation imports 3 packages (graph) and is imported by 12 packages. Updated 2020-02-14. Refresh now. Tools for package owners.