utils

package
v0.0.0-...-6879f62 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MAXLENGTH = 80

MAXLENGTH Maximum length of file name

Variables

This section is empty.

Functions

func ColumnPrintToPDF

func ColumnPrintToPDF(aid int, filename string, cookies map[string]string) error

ColumnPrintToPDF print pdf

func FileName

func FileName(name string, ext string) string

FileName filter invalid string

func FilePath

func FilePath(name, ext string, escape bool) (string, error)

FilePath gen valid file path

func FileSize

func FileSize(filePath string) (int, bool, error)

FileSize return the file size of the specified path file

func LimitLength

func LimitLength(s string, length int) string

LimitLength cut string

func M3u8URLs

func M3u8URLs(uri string) ([]string, error)

M3u8URLs get all ts urls from m3u8 url

func MergeAudioAndVideo

func MergeAudioAndVideo(paths []string, mergedFilePath string) error

MergeAudioAndVideo merge audio and video

func MergeToMP4

func MergeToMP4(paths []string, mergedFilePath string, filename string) error

MergeToMP4 merge video parts to MP4

func Mkdir

func Mkdir(elem ...string) (string, error)

Mkdir mkdir path

func UnmarshalJSON

func UnmarshalJSON(data []byte, v interface{}) error

UnmarshalJSON 将 r 中的 json 格式的数据, 解析到 v

func UnmarshalReader

func UnmarshalReader(r io.Reader, v interface{}) error

UnmarshalReader 将 r 中的 json 格式的数据, 解析到 v

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 adds delta, which may be negative, to the WaitGroup counter. 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.

Jump to

Keyboard shortcuts

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