helpers

package
v0.0.0-...-34b89f8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbExists

func DbExists(path string) (bool, error)

func GetParam

func GetParam(flags *pflag.FlagSet, key string) string

func GetParamB

func GetParamB(flags *pflag.FlagSet, key string) (string, bool)

getParamB returns a parameter as a string and a boolean to tell if it is different from the default

NOTE: we could simply bind the flags to viper and use IsSet. Although there is a bug on Viper that always returns true on IsSet if a flag is binded. Our alternative way is to manually check the flag and then the value from env/config/gotten by viper. https://github.com/spf13/viper/pull/331

Types

type CobraFunc

type CobraFunc func(cmd *cobra.Command, args []string)

func Python

func Python(fn PythonFunc, cfg PythonConfig) CobraFunc

type PythonConfig

type PythonConfig struct {
	NoDB      bool
	AllowNoDB bool
}

type PythonData

type PythonData struct {
	HadDB bool
	Store *storage.Storage
}

type PythonFunc

type PythonFunc func(cmd *cobra.Command, args []string, data PythonData)

Jump to

Keyboard shortcuts

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