utils

package
v0.0.0-...-44e9a53 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorArtist

func AuthorArtist(author string, artist string) string

func GenTitle

func GenTitle(volume string, chapter string, title string) string

func GetAndGoquery

func GetAndGoquery(url string) (*goquery.Document, error)

func GetAndJsonParse

func GetAndJsonParse(rurl string, v any) (error, bool)

does a get request to the url, than calls json.Unmarshal with the body and the second argument returns possible errors and a bool that is true if the response status code is 404

func HexToStr

func HexToStr(str string) (string, error)

func Must

func Must[T any](v T, err error) T

func StrBetween

func StrBetween(str string, left string, right string) (string, error)

func StrBetweenFirst

func StrBetweenFirst(str string, left string, right string) (string, error)

func StrConaintsIgnoreCase

func StrConaintsIgnoreCase(a string, b string) bool

func StrToHex

func StrToHex(str string) string

Types

type DistanceSorter

type DistanceSorter struct {
	Data      []*types.SearchResult
	Distances []float64
}

func (DistanceSorter) ComputeDistances

func (t DistanceSorter) ComputeDistances(query string)

TODO: temporary solution, find better algoritm

func (DistanceSorter) Len

func (a DistanceSorter) Len() int

func (DistanceSorter) Less

func (a DistanceSorter) Less(i, j int) bool

func (DistanceSorter) Swap

func (a DistanceSorter) Swap(i, j int)

Jump to

Keyboard shortcuts

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