setting

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("settings", fx.Provide(
	func() (out Result, err error) {
		err = out.LoadFromEnv()
		return
	},
),
)

Functions

This section is empty.

Types

type AllHelp

type AllHelp struct {
	fx.In
	Values []Help `group:"config.Help"`
}

AllHelp collects all config.Help instances that are in the current app container.

type Help

type Help struct {
	Name  string
	Usage string
}

Help contains usage information for an environment configuration block.

type HelpOut

type HelpOut struct {
	fx.Out
	Help Help `group:"config.Help" ignored:"true"`
}

HelpOut provides a Help instance using Fx dependency injection.

type Param

type Param struct {
	fx.In
	EnvServer string `name:"EnvServer"`
}

type Result

type Result struct {
	fx.Out
	config.EnvironmentBlock
	EnvServer string `name:"EnvServer" envconfig:"ENV_SERVER" default:"local"` //当前的环境,local,dev,test,pro
}

func (*Result) LoadFromEnv

func (g *Result) LoadFromEnv() (err error)

Jump to

Keyboard shortcuts

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