essentials

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: CC0-1.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

lem-cli-essentials

Tiny library for configuration and command line options; to save time in large programs implemented as a bunch of CLI executables. And, it also makes things more consistent.

Large microservice monsters? Same CLI everywhere, baby!

Small hello world CLI that you vibecoded (please don't)? Well, I can't stop you since this thing is licensed under CC0.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLoader = Loader{/* contains filtered or unexported fields */}
View Source
var ErrMissingConfig = fmt.Errorf("configuration file missing")

Functions

func AddCommonFlags

func AddCommonFlags(set *pflag.FlagSet)

func InitConfig

func InitConfig(cmd *cobra.Command, cfgFile string, v *viper.Viper, prefix string) error

func LoadConfig

func LoadConfig(file string, subconfigs []string, v *viper.Viper) error

func ViperEnv

func ViperEnv(v *viper.Viper, envPrefix string)

Prepares your Viper for the environment.

Types

type Loader added in v0.2.0

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader added in v0.2.0

func NewLoader(fs afero.Fs) (*Loader, error)

func (*Loader) InitConfig added in v0.2.0

func (l *Loader) InitConfig(
	cmd *cobra.Command,
	cfgFile string,
	v *viper.Viper,
	prefix string,
) error

func (*Loader) LoadConfig added in v0.2.0

func (l *Loader) LoadConfig(file string, subconfigs []string, v *viper.Viper) error

Load the other configuration files for things like rabbitmq.

func (*Loader) ViperEnv added in v0.2.0

func (l *Loader) ViperEnv(v *viper.Viper, envPrefix string)

Prepares your Viper for the environment.

func (*Loader) WithRequiredConfig added in v0.2.0

func (l *Loader) WithRequiredConfig() *Loader

Jump to

Keyboard shortcuts

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