util

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidDirSymbols = [10]rune{'/', '<', '>', ':', '"', '/', '\\', '|', '?', '*'}

Functions

func AESDecrypt added in v0.3.0

func AESDecrypt(encrypted []byte, key, iv []byte) ([]byte, error)

func FindTagByNameAttrs

func FindTagByNameAttrs(node *html.Node, name string, useAttr bool, attrs []html.Attribute) []*html.Node

func FindTagByRegExp

func FindTagByRegExp(doc string, regStr string) [][]string

func FormatSize added in v0.3.2

func FormatSize(size int64) string

FormatSize formats the file size and ensure the number of size always > 1. the unit of parameter `size` is Byte.

func Get added in v0.3.0

func Get(client *http.Client, u string, headers map[string]string) (*http.Response, error)

func GetAttrVal

func GetAttrVal(node *html.Node, name string) string

func GetHTMLPage added in v0.3.0

func GetHTMLPage(client *http.Client, u string, headers map[string]string) (*html.Node, error)

func IsSubSlice

func IsSubSlice[T comparable](dst, src []T) bool

IsSubSlice returns whether src is the sub-slice of dst

func MergeToMP4 added in v0.3.0

func MergeToMP4(fileListPath, outputPath string) error

func RandomInt63n added in v0.3.0

func RandomInt63n(min, max int64) int64

func ReplaceChars added in v0.3.2

func ReplaceChars(str string, chars []rune) string

func SliceEqual

func SliceEqual[T comparable](s1, s2 []T) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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