Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAppConfigModule ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.