grpc

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectGRPC

func ConnectGRPC(config GRPCConfig) (*grpc.ClientConn, error)

ConnectGRPC creates a production-ready gRPC client connection.

Configuration: - TLS is enabled by default; set `grpc_config.insecure` to disable. - Backoff parameters can be customized under `grpc_config` in YAML. - Keepalive is configured to maintain healthy connections under high load.

Production optimizations: - Keepalive pings detect dead connections quickly - Exponential backoff for connection retries - Increased flow control windows for high throughput - Large message sizes for batch operations

Types

type GRPCConfig

type GRPCConfig struct {
	HostPort          string        `yaml:"host_port"`
	Insecure          bool          `yaml:"insecure"`
	BackoffBaseDelay  time.Duration `yaml:"backoff_base_delay"`
	BackoffMaxDelay   time.Duration `yaml:"backoff_max_delay"`
	MinConnectTimeout time.Duration `yaml:"min_connect_timeout"`
	KeepAliveTime     time.Duration `yaml:"keep_alive_time"`
	KeepAliveTimeout  time.Duration `yaml:"keep_alive_timeout"`
}

func (*GRPCConfig) HydrateDefaults

func (c *GRPCConfig) HydrateDefaults() GRPCConfig

Jump to

Keyboard shortcuts

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