anilist

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const BaseUrl = "https://graphql.anilist.co"
View Source
const DefaultAnimeForSeasonQuery = `` /* 301-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Anilist

type Anilist interface {
	Query(context.Context, Request) (*Response, error)
}

func New

func New() Anilist

func NewWithClient

func NewWithClient(client *http.Client) Anilist

type Data

type Data struct {
	Page Page `json:"page"`
}

type Error

type Error struct {
	Message   string          `json:"message"`
	Status    int             `json:"status"`
	Locations []ErrorLocation `json:"locations"`
}

type ErrorLocation

type ErrorLocation struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

type Media

type Media struct {
	Id       int        `json:"id"`
	Title    MediaTitle `json:"title"`
	Type     string     `json:"type"`
	SiteUrl  string     `json:"siteUrl"`
	Format   string     `json:"format"`
	Status   string     `json:"status"`
	Episodes int        `json:"episodes"`
}

type MediaTitle

type MediaTitle struct {
	Romaji string `json:"romaji"`
}

type Page

type Page struct {
	PageInfo PageInfo `json:"pageInfo"`
	Media    []Media
}

type PageInfo

type PageInfo struct {
	Total       int  `json:"total"`
	PerPage     int  `json:"perPage"`
	CurrentPage int  `json:"currentPage"`
	HasNextPage bool `json:"hasNextPage"`
}

type Request

type Request struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables,omitempty"`
}

type Response

type Response struct {
	Data   Data    `json:"data"`
	Errors []Error `json:"errors"`
}

Jump to

Keyboard shortcuts

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