aduuapp

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SetupFlagsConfig added in v0.2.23

type SetupFlagsConfig struct {
	DisableWriteConfigFlag bool
}

SetupFlagsConfig contains options to enable or disable certain flags from being added.

type SetupViperConfig added in v0.2.23

type SetupViperConfig struct {
}

SetupViperConfig options ot pass to SetupViper.

type ViperSetup

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

ViperSetup stores config requires to fully setup an aduu app.

func SetupViper

func SetupViper(appName string, req *SetupViperConfig) (setup *ViperSetup, v *viper.Viper)

SetupViper sets up viper for immediate use.

func (*ViperSetup) IsWriteConfigSet

func (setup *ViperSetup) IsWriteConfigSet() bool

IsWriteConfigSet return whether the config write flag was set.

func (*ViperSetup) SetupFlags added in v0.2.23

func (setup *ViperSetup) SetupFlags(
	cmd *cobra.Command,
	flagsConfig *SetupFlagsConfig,
)

SetupFlags adds klog flags to the given command together with a -w flag. The -w flag enables saving the current viper state to the default config file.

func (*ViperSetup) WriteConfig

func (setup *ViperSetup) WriteConfig() (err error)

Jump to

Keyboard shortcuts

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