common

package
Version: v0.0.0-...-f43e39b Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskYes

func AskYes(question string, defaultYes bool) (isYes bool)

AskYes prompt a yes/no question to the prompt

func DefaultIfEmptyInt

func DefaultIfEmptyInt(v *int, defaultV int)

DefaultIfEmptyInt set the value of an int to a default if it is nulled (0)

func DefaultIfEmptyStr

func DefaultIfEmptyStr(s *string, defaultS string)

DefaultIfEmptyStr set a default for a string if it is nulled

func DefaultIfEmptyUint64

func DefaultIfEmptyUint64(v *uint64, defaultV uint64)

DefaultIfEmptyUint64 set the value of an int to a default if it is nulled (0)

func GenerateSecret

func GenerateSecret() string

GenerateSecret generate a string that can be used as secrete api key

func IsEmptyStr

func IsEmptyStr(s string) bool

IsEmptyStr tells if a string is empty or not

func IsEqStr

func IsEqStr(a, b string) bool

IsEqStr tells if two strings a and b are equals after trimming spaces and lowercasing

func RandomString

func RandomString(alphabet string, length int) (s string, err error)

RandomString generate a random string of required length using alphabet

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL