anilist

package module
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 4 Imported by: 8

README

anilist

Godoc Report Tests Coverage Sponsor

Anilist API client written in Go.

Style

Please take a look at the style guidelines if you'd like to make a pull request.

Sponsors

Cedric Fung Scott Rayapoullé Eduard Urbach
Cedric Fung Scott Rayapoullé Eduard Urbach

Want to see your own name here?

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKeyID = ""

APIKeyID ...

View Source
var APIKeySecret = ""

APIKeySecret ...

Functions

func GetAniListIDByMALID

func GetAniListIDByMALID(malID int) (int, error)

GetAniListIDByMALID ...

func Query

func Query(body interface{}, target interface{}) error

Query queries the AniList GraphQL API.

Types

type Anime

type Anime struct {
	ID    int `json:"id"`
	MALID int `json:"idMal"`
	Title struct {
		Romaji  string `json:"romaji"`
		English string `json:"english"`
		Native  string `json:"native"`
	} `json:"title"`
	EpisodeCount int `json:"episodes"`
}

Anime ...

func (anime *Anime) Link() string

Link returns the permalink to that anime.

type AnimeList

type AnimeList struct {
	Lists []struct {
		Name    string           `json:"name"`
		Entries []*AnimeListItem `json:"entries"`
	} `json:"lists"`
	User struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"user"`
}

AnimeList ...

func GetAnimeList

func GetAnimeList(userID int) (*AnimeList, error)

GetAnimeList ...

type AnimeListItem

type AnimeListItem struct {
	ID        int     `json:"id"`
	Status    string  `json:"status"`
	Score     float64 `json:"score"`
	ScoreRaw  int     `json:"scoreRaw"`
	Progress  int     `json:"progress"`
	Repeat    int     `json:"repeat"`
	Private   bool    `json:"private"`
	Notes     string  `json:"notes"`
	Anime     *Anime  `json:"media"`
	StartedAt struct {
		Year  interface{} `json:"year"`
		Month interface{} `json:"month"`
		Day   interface{} `json:"day"`
	} `json:"startedAt"`
	CompletedAt struct {
		Year  interface{} `json:"year"`
		Month interface{} `json:"month"`
		Day   interface{} `json:"day"`
	} `json:"completedAt"`
	UpdatedAt int `json:"updatedAt"`
	CreatedAt int `json:"createdAt"`
}

AnimeListItem ...

type User

type User struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

User represents an AniList user.

func GetUser

func GetUser(userName string) (*User, error)

GetUser ...

Jump to

Keyboard shortcuts

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