rpc

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(pctx context.Context, conf Config, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Dial returns a new gRPC ClientConn with some default dial and call options set

func PerRPCPassword

func PerRPCPassword(user, password string) grpc.DialOption

PerRPCPassword returns a new gRPC DialOption which includes a basic auth. password header in each RPC request.

Types

type Config

type Config struct {
	User          string
	Password      string
	ServerAddress string
	// The timeout to use for making RPC client connections in nanoseconds
	// This timeout is Only enforced when used in conjunction with the
	// grpc.WithBlock dial option.
	Timeout duration.Duration
	// The maximum number of times that a request will be retried for failures.
	// Time between retries follows an exponential backoff starting at 5 seconds
	// up to 1 minute
	MaxRetries uint
}

Config describes configuration for gRPC clients

func ConfigWithDefaults

func ConfigWithDefaults(serverAddress string) Config

ConfigWithDefaults returns a gRPC client config with default values set

Jump to

Keyboard shortcuts

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