rpc

package
v2.27.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultServiceConfig is a default gRPC connection service config which enables DNS round robin between IPs.
	// To use DNS resolver, a "dns:///" prefix should be applied to the hostPort.
	// https://github.com/grpc/grpc/blob/master/doc/naming.md
	DefaultServiceConfig = `{"loadBalancingConfig": [{"round_robin":{}}]}`

	// MaxBackoffDelay is a maximum interval between reconnect attempts.
	MaxBackoffDelay = 10 * time.Second
)

Variables

This section is empty.

Functions

func CreateGRPCConnection

func CreateGRPCConnection(hostName string, tls *tls.Config) *grpc.ClientConn

CreateGRPCConnection creates connection for gRPC calls

func CreateTLSConfig

func CreateTLSConfig(address string, cfg *config.TLS) (*tls.Config, error)

func Dial

func Dial(hostName string, tlsConfig *tls.Config) (*grpc.ClientConn, error)

Dial creates a client connection to the given target with default options. The hostName syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md. e.g. to use dns resolver, a "dns:///" prefix should be applied to the target.

func NewEmptyTLSConfig

func NewEmptyTLSConfig() *tls.Config

func NewTLSConfigForServer

func NewTLSConfigForServer(
	serverName string,
	enableHostVerification bool,
) *tls.Config

Types

type HttpGetter

type HttpGetter interface {
	Get(url string) (resp *http.Response, err error)
}

Jump to

Keyboard shortcuts

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