external

package
v0.0.0-...-085ab41 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRateLimited = errors.New("rate limited")
	ErrServerError = errors.New("server error")
)

Functions

This section is empty.

Types

type AniListClient

type AniListClient struct {
	// contains filtered or unexported fields
}

func NewAniListClient

func NewAniListClient(httpClient *http.Client) *AniListClient

func (*AniListClient) FetchMediaAll

func (c *AniListClient) FetchMediaAll(ctx context.Context) ([]*AniListMediaQuery, error)

type AniListMediaQuery

type AniListMediaQuery struct {
	Page struct {
		Media []struct {
			Title struct {
				English *string `graphql:"english" json:"english"`
				Romaji  *string `graphql:"romaji" json:"romaji"`
				Native  *string `graphql:"native" json:"native"`
			} `graphql:"title" json:"title"`
		} `graphql:"media(sort: ID, type: ANIME, countryOfOrigin: JP)" json:"media"`
		PageInfo struct {
			HasNextPage bool `graphql:"hasNextPage" json:"hasNextPage"`
		} `graphql:"pageInfo" json:"pageInfo"`
	} `graphql:"Page(page: $page, perPage: 50)" json:"page"`
}

type CachingAniListClient

type CachingAniListClient struct {
	*AniListClient
	// contains filtered or unexported fields
}

func NewCachingAniListClient

func NewCachingAniListClient(client *AniListClient, cacheDir string) (*CachingAniListClient, error)

func (*CachingAniListClient) FetchMediaAll

func (c *CachingAniListClient) FetchMediaAll(ctx context.Context) ([]*AniListMediaQuery, error)

type CachingMALClient

type CachingMALClient struct {
	*MALClient
	// contains filtered or unexported fields
}

func NewCachingMALClient

func NewCachingMALClient(client *MALClient, cacheDir string) (*CachingMALClient, error)

func (*CachingMALClient) FetchMediaAll

func (c *CachingMALClient) FetchMediaAll(ctx context.Context) ([]*MALMediaEntry, error)

type MALClient

type MALClient struct {
	// contains filtered or unexported fields
}

func NewMALClient

func NewMALClient(httpClient *http.Client) *MALClient

func (*MALClient) FetchMediaAll

func (c *MALClient) FetchMediaAll(ctx context.Context) ([]*MALMediaEntry, error)

type MALMediaEntry

type MALMediaEntry struct {
	Data []struct {
		Titles []struct {
			Type  string `json:"type"`
			Title string `json:"title"`
		} `json:"titles"`
	} `json:"data"`
	Pagination struct {
		HasNextPage bool `json:"has_next_page"`
	} `json:"pagination"`
}

Jump to

Keyboard shortcuts

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