utils

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigramSearch

func BigramSearch(keyword string, items []string) []string

BigramSearch finds items that are similar to the given keyword based on bigram similarity.

func CompareStrings

func CompareStrings(str1, str2 string) float64

CompareStrings computes a similarity score between two strings using bigrams.

func CopyFile

func CopyFile(src, dst string) error

func CountImageFiles

func CountImageFiles(archiveFilePath string) (int, error)

CountImageFiles counts the number of image files in an archive (zip, cbz, rar, or cbr).

func DownloadImage

func DownloadImage(downloadDir, fileName, fileUrl string) error

DownloadImage downloads an image from the specified URL, saves it in the original and resized formats.

func ExtractFirstImage

func ExtractFirstImage(archivePath, outputFolder string) error

ExtractFirstImage extracts the first image from an archive and saves it to the output folder.

func ExtractNumber

func ExtractNumber(name string) (int, error)

ExtractNumber extracts the first number found in the given string.

func LogDuration added in v1.0.2

func LogDuration(functionName string, start time.Time, args ...interface{})

LogDuration logs the duration of a function execution

func ProcessImage

func ProcessImage(fromPath, toPath string) error

ProcessImage processes an image by resizing and cropping it, then saving it to a new file.

func RemovePatterns

func RemovePatterns(path string) string

RemovePatterns applies custom parsing to clean up the path string.

func Sluggify

func Sluggify(s string) string

Sluggify transforms a string into a URL-friendly slug.

Types

This section is empty.

Jump to

Keyboard shortcuts

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