config

package
v0.0.0-...-97f8d3b Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireFromEnv

func RequireFromEnv(name string) (string, error)

Require an option from an environment variable

Types

type KafkaConfig

type KafkaConfig struct {
	// Env Var: "KAFKA_BROKERS"
	// Comma delimited from env var.
	Brokers []string
}

func (*KafkaConfig) Load

func (cfg *KafkaConfig) Load() error

type OtelConfig

type OtelConfig struct {
	// Env Var: "OTEL_COLLECTOR_GRPC"
	CollectorGrpc string
}

func (*OtelConfig) Load

func (cfg *OtelConfig) Load() error

type PostgresConfig

type PostgresConfig struct {
	// Env Var: "PG_USER"
	Username string

	// Env Var: "PG_PASS"
	Password string

	// Env Var: "PG_HOST"
	Host string

	// Env Var: "PG_PORT" (optional)
	// Defaults to "5432"
	Port string

	// Env Var: "PG_DB"
	Database string
}

func (*PostgresConfig) GetDSN

func (conf *PostgresConfig) GetDSN() string

func (*PostgresConfig) Load

func (cfg *PostgresConfig) Load() error

type SharedConfig

type SharedConfig struct {
	// Env Var: "MODE" (optional)
	// 'dev' or 'development' -> true
	// Defaults to false
	DevMode bool

	Otel OtelConfig
}

Shared configuration implemented by all services

func (*SharedConfig) Load

func (cfg *SharedConfig) Load() error

Load the options in the shared config

Jump to

Keyboard shortcuts

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