Documentation
¶
Index ¶
- Constants
- func Domain(url string) string
- func FileName(name string) string
- func FilePath(name, ext string, escape bool) string
- func FileSize(filePath string) (int64, bool)
- func GetNameAndExt(uri string) (string, string)
- func LimitLength(s string, length int) string
- func M3u8URLs(uri string) []string
- func MatchAll(text, pattern string) [][]string
- func MatchOneOf(text string, patterns ...string) []string
- func Md5(text string) string
- func PrintVersion()
- func ShouldExtract(format, bestQuality string) bool
- func StringInSlice(str string, list []string) bool
- type WaitGroupPool
Constants ¶
const MAXLENGTH = 80
MAXLENGTH Maximum length of file name
Variables ¶
This section is empty.
Functions ¶
func GetNameAndExt ¶
GetNameAndExt return the name and ext of the URL https://img9.bcyimg.com/drawer/15294/post/1799t/1f5a87801a0711e898b12b640777720f.jpg -> 1f5a87801a0711e898b12b640777720f, jpg
func LimitLength ¶
LimitLength Handle overly long strings
func MatchOneOf ¶
MatchOneOf match one of the patterns
func ShouldExtract ¶
ShouldExtract returns true, if we need to extract this format
func StringInSlice ¶
StringInSlice if a string is in the list
Types ¶
type WaitGroupPool ¶
type WaitGroupPool struct {
// contains filtered or unexported fields
}
WaitGroupPool pool of WaitGroup
func NewWaitGroupPool ¶
func NewWaitGroupPool(size int) *WaitGroupPool
NewWaitGroupPool creates a sized pool for WaitGroup
func (*WaitGroupPool) Add ¶
func (p *WaitGroupPool) Add()
Add increments the WaitGroup counter by one. See sync.WaitGroup documentation for more information.
func (*WaitGroupPool) Done ¶
func (p *WaitGroupPool) Done()
Done decrements the WaitGroup counter by one. See sync.WaitGroup documentation for more information.
func (*WaitGroupPool) Wait ¶
func (p *WaitGroupPool) Wait()
Wait blocks until the WaitGroup counter is zero. See sync.WaitGroup documentation for more information.