utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanElement

func CleanElement(html string, re *regexp.Regexp) []string

func CleanText

func CleanText(str string) string

func GetPlatforms

func GetPlatforms() []string

func NewRequest

func NewRequest(method, url string, body io.Reader, headers [][2]string, clientConfig *http.Client) ([]byte, int, error)

func NewRequestBrowser

func NewRequestBrowser(method, url string, body io.Reader) ([]byte, int, error)

func RenderImagenFromURL

func RenderImagenFromURL(url string, cols, row int) (string, error)

func SearchElements

func SearchElements(html string, re *regexp.Regexp) [][]string

func TruncateText

func TruncateText(str string, maxLength int) string

Types

type AnilistDataAnime

type AnilistDataAnime struct {
	Media MediaModel `json:"Media"`
}

type AnilistDataPage

type AnilistDataPage struct {
	Page AnilistPage `json:"Page"`
}

type AnilistPage

type AnilistPage struct {
	Media []MediaModel `json:"media"`
}

type AnilistResponseAnime

type AnilistResponseAnime struct {
	Data AnilistDataAnime `json:"data"`
}

func RequestAnilistAnime

func RequestAnilistAnime(anime string) (AnilistResponseAnime, error)

type AnilistResponseList

type AnilistResponseList struct {
	Data AnilistDataPage `json:"data"`
}

func RequestAnimeList

func RequestAnimeList(anime string) (AnilistResponseList, error)

type AnimeChoice

type AnimeChoice struct {
	ImagePath     string
	ImageRendered string
	Name          string
	Desc          string
}

func (AnimeChoice) Description

func (i AnimeChoice) Description() string

func (AnimeChoice) FilterValue

func (i AnimeChoice) FilterValue() string

func (AnimeChoice) Title

func (i AnimeChoice) Title() string

type DataModel

type DataModel struct {
	Media MediaModel `json:"media"`
}

type EpisodesAnime

type EpisodesAnime struct {
	Episode uint
}

func (EpisodesAnime) Description

func (i EpisodesAnime) Description() string

func (EpisodesAnime) FilterValue

func (i EpisodesAnime) FilterValue() string

func (EpisodesAnime) Title

func (i EpisodesAnime) Title() string

type GraphQLRequest

type GraphQLRequest struct {
	Query     string         `json:"query"`
	Variables map[string]any `json:"variables"`
}

type MediaModel

type MediaModel struct {
	Id                int                    `json:"id"`
	Status            string                 `json:"status"`
	Episodes          *uint                  `json:"episodes"`
	NextAiringEpisode NextAiringEpisodeModel `json:"nextAiringEpisode"`
	Title             TitleModel             `json:"title"`
	Description       string                 `json:"description"`
}

type NextAiringEpisodeModel

type NextAiringEpisodeModel struct {
	Episode *uint `json:"episode"`
}

type PlatformChoice

type PlatformChoice struct {
	NamePlatform string
}

func (PlatformChoice) Description

func (i PlatformChoice) Description() string

func (PlatformChoice) FilterValue

func (i PlatformChoice) FilterValue() string

func (PlatformChoice) Title

func (i PlatformChoice) Title() string

type TitleModel

type TitleModel struct {
	Romaji  string `json:"romaji"`
	English string `json:"english"`
	Native  string `json:"native"`
}

Jump to

Keyboard shortcuts

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