mfx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 3 Imported by: 1

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

func CreateAppModule() (AppResult, error)

CreateAppModule load the application settings from the environment.

Jump to

Keyboard shortcuts

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