rpc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 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 added in v0.3.0

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

CreateGRPCConnection creates connection for gRPC calls

func CreateTLSConfig added in v0.2.0

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 added in v0.2.0

func NewEmptyTLSConfig() *tls.Config

func NewTLSConfigForServer added in v0.2.0

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

Types

type HttpGetter added in v0.2.0

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