grpcdialer

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TCPDialer

func TCPDialer(address string, port int, lg Printer) grpc.DialOption

TCPDialer returns a grpc.DialOption for connecting to a TCP socket with given address and port number. Logging messages will be sent to lg, if non-nil. The dial will be retried on error.

func WebSocketDialer

func WebSocketDialer(uri string, lg Printer) grpc.DialOption

WebSocketDialer returns a grpc.DialOption for connecting to a web-socket with given URI. Logging messages will be sent to lg, if non-nil. The dial will be retried on error.

func WithContextDialer

func WithContextDialer(dial DialWithContextFunc) grpc.DialOption

WithContextDialer returns a grpc.DialOption for the given DialWithContextFunc.

func WithRetryContextDialer

func WithRetryContextDialer(dial DialWithContextFunc) grpc.DialOption

WithRetryContextDialer returns a grpc.DialOption for the given DialWithContextFunc. The dial will be retried on error.

Types

type DialWithContextFunc

type DialWithContextFunc func(ctx context.Context) (net.Conn, error)

DialWithContextFunc defines a function that can be used to dial a connection.

type Printer

type Printer interface {
	Printf(format string, v ...interface{})
}

Printer is the interface satisfied by the Printf method.

Jump to

Keyboard shortcuts

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