utils

package
v1.2.60 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountSI added in v1.2.27

func ByteCountSI(b int64) string

ByteCountSI turn bytes to SI (decimal) format - https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/

func CalcSizeInByte

func CalcSizeInByte(number float64, unit string) int64

CalcSizeInByte func

func GetFileExt

func GetFileExt(str string) string

GetFileExt from simple string

func GetH1

func GetH1(htmlString *string, idx int) string

GetH1 of html - file idx -1 = last h1 found - if index out of range set to last h1

func GetLastItemString

func GetLastItemString(slice []string) string

GetLastItemString of slice

func GetMediaType

func GetMediaType(t string) static.DataType

GetMediaType e.g. put in png get image, mp4 -> video

func GetMeta

func GetMeta(htmlString *string, property string) string

GetMeta of HTML file

func GetSectionHeadingElement added in v1.2.32

func GetSectionHeadingElement(htmlString *string, level, idx int) string

func NeedDownloadList

func NeedDownloadList(length int) []int

NeedDownloadList return the indices of gallery that need download

func RemoveAdjDuplicates

func RemoveAdjDuplicates[T string | int](slice []T) []T

RemoveAdjDuplicates of slice

func Wrap

func Wrap(err error, ctx string) error

Wrap error with context

Types

This section is empty.

Jump to

Keyboard shortcuts

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