config

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(spec interface{}) error

Load fills in all of a structure's variables from the environment. If spec has a provided Help then it will also be filled in.

func LoadFromVault

func LoadFromVault(spec interface{}) error

func LoadWithPrefix

func LoadWithPrefix(prefix string, spec interface{}) error

Load fills in all of a structure's variables from the environment with prefix. If spec has a provided Help then it will also be filled in.

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 BoolVar

type BoolVar struct {
	Value bool
}

type EnvironmentBlock

type EnvironmentBlock struct {
	fx.Out
	HelpOut
}

EnvironmentBlock is used to compose an environment config block.

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 StringVar

type StringVar struct {
	Value string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳