Help us shape the future of Go! Take the 2026 Go Developer Survey

autobind

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ViperTag = "viper"
	CobraTag = "cobra"
	EnvTag   = "env"
)

Variables

This section is empty.

Functions

func AutoBind

func AutoBind(vp *viper.Viper, cfg interface{}) func(cmd *cobra.Command, args []string) error

Types

type Autobinder added in v0.0.2

type Autobinder struct {
	ConfigObject interface{}
	Viper        *viper.Viper
	UseNesting   bool
	EnvPrefix    string // Viper prefix for environment variables, viper does not expose this, and because we construct the ENV variables, the prefix isn't set by Viper.
}

func (*Autobinder) Bind added in v0.0.2

func (b *Autobinder) Bind(ctx context.Context, cmd *cobra.Command, prefix []string)

Jump to

Keyboard shortcuts

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