config

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig[T any](path string, target *T) error

Loads config into the target struct from the given path - an INI file. Can override config values with environment variables. Don't put secrets in the INI file. It first loads the INI file and then overrides the values with environment variables.

Types

type BootConfig

type BootConfig struct {
	// ssl
	SslBucket string `ini:"ssl_bucket"`
	Domain    string `ini:"domain"`

	// Cloud
	AzureStorageAccount string `ini:"azure_storage_account"`
	AzureKeyVaultName   string `ini:"azure_key_vault_name"`

	GcpProjectId string `ini:"gcp_project_id"`
}

Note: go-api-boot holds clear distinction between config and secrets. Config is for application configuration that can be stored in version control. Secrets are sensitive information like API keys, passwords, etc. that should not be stored in version control. Secrets should be exclusively read from environment variables.

Jump to

Keyboard shortcuts

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