Help us shape the future of Go! Take the 2026 Go Developer Survey

grpc

package
v0.81.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backoff

func Backoff(ctx context.Context) backoff.BackOff

Backoff returns a backoff configuration for gRPC calls

func CreateConnection

func CreateConnection(ctx context.Context, addr string, tlsEnabled bool, component string, extraOpts ...grpc.DialOption) (*grpc.ClientConn, error)

CreateConnection creates a gRPC client connection with the appropriate transport options. The component parameter specifies the WebSocket proxy component path (e.g., "/management", "/signal").

func Retry added in v0.77.1

func Retry(ctx context.Context, operation backoff.Operation, bo backoff.BackOff, watcher ChangeWatcher) error

Retry mirrors backoff.Retry, but the sleep between attempts also wakes on OS network availability transitions: an operation cut down by a network change retries the moment the network settles instead of sleeping through the recovery. A nil watcher never fires, leaving plain backoff.Retry behavior.

func WithCustomDialer

func WithCustomDialer(_ bool, _ string) grpc.DialOption

func WithSweeper added in v0.77.1

func WithSweeper(sweeper Sweeper) grpc.DialOption

WithSweeper dials like WithCustomDialer but registers connections and dials with the sweeper. Append it after WithCustomDialer: gRPC applies dial options in order, so the later context dialer wins.

Types

type ChangeWatcher added in v0.78.0

type ChangeWatcher interface {
	Changed() <-chan struct{}
}

ChangeWatcher exposes OS network availability transitions.

type Sweeper added in v0.78.0

type Sweeper interface {
	StartDial(ctx context.Context) *sweep.Dial
}

Sweeper registers in-flight dials for the network change sweep.

Jump to

Keyboard shortcuts

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