config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceEnvPlaceholders

func ReplaceEnvPlaceholders(configValue string) string

ReplaceEnvPlaceholders replaces placeholders of the format ${VAR_NAME} with their environment variable values only if the variable is set.

Types

type AppConfig

type AppConfig struct {
	Environment     string
	LogLevel        string `envconfig:"LOG_LEVEL"        default:"DEBUG"`
	PG              PGConfig
	RPC             RPCConfig
	ShutdownTimeout time.Duration `envconfig:"SHUTDOWN_TIMEOUT" default:"30s"`
}

func InitConfig

func InitConfig() (AppConfig, error)

type PGConfig

type PGConfig struct {
	Conn string `` /* 126-byte string literal not displayed */
}

type RPCConfig

type RPCConfig struct {
	Host string `default:"0.0.0.0"`
	Port string `default:":8085"`
}

func (RPCConfig) Address

func (c RPCConfig) Address() string

Jump to

Keyboard shortcuts

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