grpcconfig

package
v0.38.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultReconnectInterval = time.Minute

Variables

This section is empty.

Functions

func IterateEndpoints

func IterateEndpoints(c *config.Config, f func(*Config))

IterateEndpoints iterates over subsections of "grpc" section of c, wrap them into Config and passes to f.

Section names are expected to be consecutive integer numbers, starting from 0.

Panics if N is not a positive number.

func ReconnectTimeout added in v0.38.0

func ReconnectTimeout(c *config.Config) time.Duration

ReconnectTimeout returns the value of "reconnect_interval" gRPC config parameter.

Returns DefaultReconnectInterval if value is not defined or invalid.

Types

type Config

type Config config.Config

Config is a wrapper over the config section which provides access to gRPC server configurations.

func (*Config) Endpoint

func (x *Config) Endpoint() string

Endpoint returns the value of "endpoint" config parameter.

Panics if the value is not a non-empty string.

func (*Config) TLS

func (x *Config) TLS() *TLSConfig

TLS returns "tls" subsection as a TLSConfig.

Returns nil if "enabled" value of "tls" subsection is false.

type TLSConfig

type TLSConfig struct {
	// contains filtered or unexported fields
}

TLSConfig is a wrapper over the config section which provides access to TLS configurations of the gRPC server.

func (TLSConfig) CertificateFile

func (tls TLSConfig) CertificateFile() string

CertificateFile returns the value of "certificate" config parameter.

Panics if the value is not a non-empty string.

func (TLSConfig) KeyFile

func (tls TLSConfig) KeyFile() string

KeyFile returns the value of "key" config parameter.

Panics if the value is not a non-empty string.

func (TLSConfig) UseInsecureCrypto

func (tls TLSConfig) UseInsecureCrypto() bool

UseInsecureCrypto returns true if TLS 1.2 cipher suite should not be restricted.

Jump to

Keyboard shortcuts

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