Documentation ¶
Index ¶
- Constants
- Variables
- func AnsiStrip(str string) string
- func ArgOrPipe(args string) (string, error)
- func CalcPermutation(n, r int) int
- func CalcPermutationMore(n, r1, r2 int) int
- func ContainsItems[T comparable](s1 []T, s2 []T) bool
- func CopyFile(dest, src string) error
- func Dedupe[T comparable](inputSlice []T) (result []T)
- func GenerateAlphabet(regex string) []byte
- func GeneratePassword(password string) string
- func GenerateToken(token, username string) (string, error)
- func GetArgFilePipe(arg string) ([]byte, error)
- func GetFileBytes(path string) ([]byte, error)
- func GetFileOrPipe(args []string) ([]byte, error)
- func GetFileString(path string) (string, error)
- func GetFirstArg(args []string) (string, error)
- func GetFromPipe() ([]byte, error)
- func GetHeaderToken(authorization string) (token string, err error)
- func Intersection[T comparable](s1, s2 []T) []T
- func OutputBytes(s []byte) error
- func PickRandom[T any](v []T) T
- func PruneEmptyStrings(v []string) []string
- func PruneEqual[T comparable](inputSlice []T, equalTo T) (r []T)
- func RandomBytesByLength[T constraints.Integer](n T, regex ...string) []byte
- func RandomString() string
- func RandomStringByLength[T constraints.Integer](n T, regex ...string) string
- func RefreshToken(tokenString string) (string, error)
- func SliceContains[T comparable](inputSlice []T, element T) bool
- func SliceToInt(s []string) ([]int, error)
- func TableOutput(datas [][]*simpletable.Cell, header, footer []*simpletable.Cell) string
- func ValidArg(field interface{}, tag string) error
- func ValidFlag(field interface{}, tag string) error
- func Validator(field interface{}, tag string, errMsg string) error
- func VerifyPassword(hash, password string) bool
- type Claims
- type OncePlus
Constants ¶
View Source
const ( ErrMsgArg = "plz input arg:{%s}" ErrMsgFlag = "plz input flag:{%s}" )
Variables ¶
View Source
var HideHelpCommand func(c []*cli.Command)
Functions ¶
func CalcPermutation ¶
func CalcPermutationMore ¶
func ContainsItems ¶
func ContainsItems[T comparable](s1 []T, s2 []T) bool
ContainsItems checks if s1 contains s2
func Dedupe ¶
func Dedupe[T comparable](inputSlice []T) (result []T)
Dedupe removes duplicates from a slice of elements preserving the order
func GenerateAlphabet ¶ added in v0.1.9
func GeneratePassword ¶
GeneratePassword - Generate bcrypt hash password
func GenerateToken ¶
GenerateToken generate tokens used for auth
func GetArgFilePipe ¶ added in v0.1.6
GetArgFilePipe Get arg from c.Arg > File > Pipe
func GetFileBytes ¶ added in v0.1.6
func GetFileOrPipe ¶ added in v0.1.6
func GetFileString ¶ added in v0.1.6
func GetFromPipe ¶ added in v0.1.6
func GetHeaderToken ¶
func Intersection ¶
func Intersection[T comparable](s1, s2 []T) []T
func PruneEmptyStrings ¶
PruneEmptyStrings from the slice
func PruneEqual ¶
func PruneEqual[T comparable](inputSlice []T, equalTo T) (r []T)
PruneEqual removes items from the slice equal to the specified value
func RandomBytesByLength ¶ added in v0.1.6
func RandomBytesByLength[T constraints.Integer](n T, regex ...string) []byte
RandomBytesByLength 随机字符串
func RandomStringByLength ¶
func RandomStringByLength[T constraints.Integer](n T, regex ...string) string
RandomStringByLength 随机字符串
func SliceContains ¶
func SliceContains[T comparable](inputSlice []T, element T) bool
SliceContains if a slice contains an element
func SliceToInt ¶
ToInt converts a slice of strings to a slice of ints
func TableOutput ¶ added in v0.1.6
func TableOutput(datas [][]*simpletable.Cell, header, footer []*simpletable.Cell) string
func VerifyPassword ¶
VerifyPassword - Verify bcrypt hash password
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.