Versions in this module Expand all Collapse all v0 v0.19.4 May 24, 2023 Changes in this version + var ErrAlreadyExist = errors.New("resource already exists") + var ErrInvalidArgument = errors.New("invalid argument") + var ErrNotEmpty = errors.New("not-empty") + var ErrNotExist = errors.New("resource does not exist") + var ErrPermissionDenied = errors.New("permission denied") + func AESGCMDecrypt(key, ciphertext []byte) ([]byte, error) + func AESGCMEncrypt(key, plaintext []byte) ([]byte, error) + func ApplyUmask(f string, newMode os.FileMode) error + func CommonSkip(name string) bool + func CopyFile(src, dest string) error + func CreatePublicKeyFingerprint(key crypto.PublicKey) ([]byte, error) + func CryptoRandomBytes(length int64) ([]byte, error) + func CryptoRandomInt(limit int64) (int64, error) + func CryptoRandomString(length int64) (string, error) + func Debounce(d time.Duration) func(f func()) + func FilePathJoinAbs(base string, sub ...string) string + func FileURLToPath(u *url.URL) (string, error) + func GenerateKeyPair(bits int) (string, string, error) + func GetLuminance(r, g, b float64) float64 + func HexToRBGColor(colorString string) (float64, float64, float64) + func HomeDir() (home string, err error) + func IsDir(dir string) (bool, error) + func IsEmptyReader(r io.Reader) (err error) + func IsEmptyString(s string) bool + func IsExist(path string) (bool, error) + func IsFile(filePath string) (bool, error) + func IsReadmeFileExtension(name string, ext ...string) (int, bool) + func IsReadmeFileName(name string) bool + func Max(a, b int) int + func Min(a, b int) int + func NewAlreadyExistErrorf(message string, args ...interface{}) error + func NewInvalidArgumentErrorf(message string, args ...interface{}) error + func NewNotExistErrorf(message string, args ...interface{}) error + func NewPermissionDeniedErrorf(message string, args ...interface{}) error + func NewSilentWrapErrorf(unwrap error, message string, args ...interface{}) error + func NormalizeEOL(input []byte) []byte + func PackData(data ...interface{}) ([]byte, error) + func PaginateSlice(list interface{}, page, pageSize int) interface + func PathEscapeSegments(path string) string + func PathJoinRel(elem ...string) string + func PathJoinRelX(elem ...string) string + func ReadAtMost(r io.Reader, buf []byte) (n int, err error) + func Remove(name string) error + func RemoveAll(name string) error + func Rename(oldpath, newpath string) error + func SanitizeCredentialURLs(s string) string + func SanitizeErrorCredentialURLs(err error) error + func SecToTime(duration int64) string + func ShellEscape(toEscape string) string + func SliceContains(slice []T, target T) bool + func SliceContainsFunc(slice []T, targetFunc func(T) bool) bool + func SliceContainsString(slice []string, target string, insensitive ...bool) bool + func SliceEqual(s1, s2 []T) bool + func SliceRemoveAll(slice []T, target T) []T + func SliceRemoveAllFunc(slice []T, targetFunc func(T) bool) []T + func SliceSortedEqual(s1, s2 []T) bool + func SplitStringAtByteN(input string, n int) (left, right string) + func StatDir(rootPath string, includeDir ...bool) ([]string, error) + func ToFloat64(number interface{}) (float64, error) + func ToInt64(number interface{}) (int64, error) + func ToSnakeCase(input string) string + func ToTitleCase(s string) string + func ToTitleCaseNoLower(s string) string + func ToUpperASCII(s string) string + func URLJoin(base string, elems ...string) string + func UnpackData(buf []byte, data ...interface{}) error + func UseLightTextOnBackground(r, g, b float64) bool + type OptionalBool byte + const OptionalBoolFalse + const OptionalBoolNone + const OptionalBoolTrue + func OptionalBoolOf(b bool) OptionalBool + func OptionalBoolParse(s string) OptionalBool + func (o OptionalBool) IsFalse() bool + func (o OptionalBool) IsNone() bool + func (o OptionalBool) IsTrue() bool + type SilentWrap struct + Err error + Message string + func (w SilentWrap) Error() string + func (w SilentWrap) Unwrap() error