util

package
v0.0.0-...-2a1c7dc Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommonFlags

func AddCommonFlags(cmdline *pflag.FlagSet) *bool

AddCommonFlags add common flags that is needed by all modules

func FileExists

func FileExists(filename string) (bool, error)

FileExists check file exists

func GetIPAddress

func GetIPAddress() (addrList []string)

GetIPAddress get local usable inner ip address

func InitFlags

func InitFlags()

InitFlags normalizes and parses the command line flags

func RandomInt

func RandomInt(limit int) int

RandomInt get a random int less than limit

func RandomString

func RandomString(length int) string

RandomString get a random string made up of alphabet characters with given length.

func WarnWordSepNormalizeFunc

func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators

func WordSepNormalizeFunc

func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WordSepNormalizeFunc changes all flags that contain "_" separators

Types

This section is empty.

Jump to

Keyboard shortcuts

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