conf

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayConfig

type GatewayConfig struct {
	config.Config
	ServerAddress string  `env:"SERVER_ADDRESS"`
	Metrics       Metrics `envPrefix:"METRICS_"`
	Tracing       Tracing `envPrefix:"TRACING_"`
}

GatewayConfig holds the configuration for gRPC clients. It currently uses env vars, but it can eventually migrate to a different config provider.

func ReadGatewayConfig

func ReadGatewayConfig() (GatewayConfig, error)

ReadGatewayConfig reads the GatewayConfig from environment variables.

type Metrics

type Metrics struct {
	Enabled bool   `env:"ENABLED" envDefault:"true"`
	Host    string `env:"HOST" envDefault:"localhost"`
	Port    uint16 `env:"PORT" envDefault:"4317"`
}

func (Metrics) Address

func (m Metrics) Address() string

type ServerConfig

type ServerConfig struct {
	config.Config
	DB      config.Database `envPrefix:"DATABASE_"`
	Metrics Metrics         `envPrefix:"METRICS_"`
	Tracing Tracing         `envPrefix:"TRACING_"`
}

ServerConfig holds the configuration for gRPC servers. It currently uses env vars, but it can eventually migrate to a different config provider.

func ReadServerConfig

func ReadServerConfig() (ServerConfig, error)

ReadServerConfig reads the ServerConfig from environment variables.

func (ServerConfig) Listener

func (c ServerConfig) Listener() (network string, address string)

Listener returns the configuration needed to initialize a net.Listener instance.

type Tracing

type Tracing struct {
	Enabled bool   `env:"ENABLED" envDefault:"true"`
	Host    string `env:"HOST" envDefault:"localhost"`
	Port    uint16 `env:"PORT" envDefault:"4317"`
}

func (Tracing) Address

func (t Tracing) Address() string

Jump to

Keyboard shortcuts

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