config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppConfigModule

func NewAppConfigModule() fx.Option

NewAppConfigModule creates a new fx module for application configuration. It provides AppConfig instance loaded from environment variables.

Required environment variables:

  • APP_ENV: Environment name (e.g., "local", "staging", "pro")
  • APP_SERVICE_NAME: Service name
  • APP_SERVICE_VERSION: Service version

Optional environment variables:

  • CONFIG_FILE: Full path to config file (default: ./configs/config.{env}.yaml)

func NewViperModule

func NewViperModule() fx.Option

Types

type AppConfig

type AppConfig struct {
	// ConfigFile is the full path to the config file
	ConfigFile string
	// ServiceName is the name of the service
	ServiceName string
	// ServiceVersion is the version of the service
	ServiceVersion string
	// Environment is the deployment environment (e.g., "local", "staging", "pro")
	Environment string
	// IsKubernetes indicates if the application is running in Kubernetes
	IsKubernetes bool
}

AppConfig represents the core application metadata and configuration paths. This is loaded from environment variables and provides service identity and configuration file location information.

Jump to

Keyboard shortcuts

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