utils

package
v0.0.0-...-aa3a249 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PREFIX_COBRA_COMMAND_ERROR = "Error:\n"
)

Variables

View Source
var (
	NoArgs            = cli.NoArgs
	RequiresMinArgs   = cli.RequiresMinArgs
	RequiresMaxArgs   = cli.RequiresMaxArgs
	RequiresRangeArgs = cli.RequiresRangeArgs
	ExactArgs         = cli.ExactArgs

	ShowHelp = command.ShowHelp
)

Functions

func Choose

func Choose(ok bool, first, second string) string

func FileExist

func FileExist(filepath string) bool

func FirstOne

func FirstOne(name ...string) string

func GetBinaryDir

func GetBinaryDir() string

func MakeArgument

func MakeArgument(args map[string]string) string

func OpenFile

func OpenFile(filename string) (*os.File, error)

func ReadFile

func ReadFile(filename string) (string, error)

func SetFlagErrorFunc

func SetFlagErrorFunc(cmd *cobra.Command)

func SetHelpTemplate

func SetHelpTemplate(cmd *cobra.Command)

func SetUsageTemplate

func SetUsageTemplate(cmd *cobra.Command)

func Str2Bool

func Str2Bool(s string) (bool, bool)

func Str2Int

func Str2Int(s string) (int, bool)

func UnixMilli

func UnixMilli() int64

func UnixSec

func UnixSec() int64

func WriteFile

func WriteFile(filename, data string, mode int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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