utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateFormats = []string{"2006-01-02 15:04:05", "2006-01-02 15:04", "2006-01-02"}

Functions

func Bool

func Bool(value interface{}) bool

func CheckInList

func CheckInList(f []string, v string) bool

func Compare

func Compare(value interface{}, other interface{}) int

func DeepCopy

func DeepCopy(m map[string]interface{}) map[string]interface{}

func FileBaseName

func FileBaseName(file string) string

func FileExists

func FileExists(path string) bool

func FileList

func FileList(path string) ([]string, error)

func Merge

func Merge(v0, v1 interface{}) interface{}

func NewTaskPool added in v0.1.2

func NewTaskPool(wg *sync.WaitGroup, size int, f func(interface{})) *taskPool

func ParseTime

func ParseTime(value string) (time.Time, error)

func RemoveDir

func RemoveDir(path string) error

func Sort added in v0.1.2

func Sort(key string, f func(string, int, int) int) func(int, int) bool

func SplitPrefix

func SplitPrefix(str string, split string) []string

func SplitTrim

func SplitTrim(str string, split string) []string

func StringConcat

func StringConcat(strs ...string) string

func StringReplace

func StringReplace(s string, vars map[string]string) string

func Truncate

func Truncate(text string, length int, ellipsis string) string

func TruncateHTML

func TruncateHTML(text string, length int, ellipsis string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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