grpcconfig

package
v0.47.7 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultKeepaliveMinTime = 10 * time.Second
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) KeepaliveEnforcementPolicy added in v0.47.7

func (x *Config) KeepaliveEnforcementPolicy() *KeepaliveEnforcementPolicy

KeepaliveEnforcementPolicy returns "keepalive_enforcement_policy" subsection as a KeepaliveEnforcementPolicy.

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

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

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

KeepaliveEnforcementPolicy is a wrapper over the config section which provides access to option to set keepalive enforcement policy on the server-side. Server will close connection with a client that violates this policy.

func (*KeepaliveEnforcementPolicy) MinTime added in v0.47.7

MinTime returns the value of "min_time" config parameter.

Returns DefaultKeepaliveMinTime if value is not defined or invalid.

func (*KeepaliveEnforcementPolicy) PermitWithoutStream added in v0.47.7

func (k *KeepaliveEnforcementPolicy) PermitWithoutStream() bool

PermitWithoutStream returns the value of "permit_without_stream" config parameter.

Returns false if the value isn't specified.

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