Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SettingModule = fx.Provide( func() (out AppResult, err error) { return CreateAppModule() }, )
SettingModule is a module that provides the application settings.
Functions ¶
This section is empty.
Types ¶
type AppParams ¶
type AppParams struct { fx.In AppName string `name:"AppName"` AppId string `name:"AppId"` Deployment string `name:"Deployment"` Version string `name:"Version"` }
AppParams is the parameters for the application.
type AppResult ¶
type AppResult struct { fx.Out // AppName is the name of the application. AppName string `name:"AppName" envconfig:"APP_NAME" default:"app"` // AppId is the id of the application. AppId string `name:"AppId" envconfig:"APP_ID" default:"app"` // Deployment is the deployment of the application: local, dev, prod // you can customize it as your need local_<name> = local, dev_<name> = dev, prod_<name> = prod Deployment string `name:"Deployment" envconfig:"DEPLOYMENT" default:"local"` // Version is the version of the application. Version string `name:"Version" envconfig:"VERSION" default:"0.0.1"` }
AppResult is the result of the application.
func CreateAppModule ¶ added in v1.0.3
CreateAppModule load the application settings from the environment.
Click to show internal directories.
Click to hide internal directories.