anilist

package module
v0.0.0-...-50be1b8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

README

go-anilist GoDoc

Unofficial client for AniList.

License

Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HomeURL *url.URL
	APIURL  *url.URL
)

Functions

This section is empty.

Types

type Airing

type Airing struct {
	RawTime     string `json:"time"`
	Countdown   int    `json:"countdown"`
	NextEpisode int    `json:"next_episode"`
}

func (*Airing) Time

func (airing *Airing) Time() (t time.Time, err error)

type Anime

type Anime struct {
	Id   int    `json:"id"`
	Type string `json:"type"`

	TitleRomaji   string   `json:"title_romaji"`
	TitleJapanese string   `json:"title_japanese"`
	TitleEnglish  string   `json:"title_english"`
	Synonyms      []string `json:"synonyms"`
	Genres        []string `json:"genres"`

	Description string `json:"description"`

	ImageURLSmall  string `json:"image_url_sml"`
	ImageURLMedium string `json:"image_url_med"`
	ImageURLLarge  string `json:"image_url_lge"`
	ImageURLBanner string `json:"image_url_banner"`

	StartDate string `json:"start_date"`
	EndDate   string `json:"end_date"`

	Hashtag string `json:"hashtag"`
	Source  string `json:"source"`

	DurationMinutes int     `json:"duration"`
	AiringStatus    string  `json:"airing_status"`
	TotalEpisodes   int     `json:"total_episodes"`
	Airing          *Airing `json:"airing"`

	RelationType string `json:"relation_type"`
}

func (*Anime) AnimeSmall

func (anime *Anime) AnimeSmall() (sml *AnimeSmall, err error)

type AnimeSmall

type AnimeSmall struct {
	Id   int    `json:"id"`
	Type string `json:"type"`

	AiringStatus  string `json:"airing_status"`
	TotalEpisodes int    `json:"total_episodes"`

	TitleRomaji   string   `json:"title_romaji"`
	TitleJapanese string   `json:"title_japanese"`
	TitleEnglish  string   `json:"title_english"`
	Synonyms      []string `json:"synonyms"`

	ImageURLSmall  string `json:"image_url_sml"`
	ImageURLMedium string `json:"image_url_med"`
	ImageURLLarge  string `json:"image_url_lge"`

	RelationType string `json:"relation_type"`
}

type Character

type Character struct {
	Id             int    `json:"id"`
	FirstName      string `json:"name_first"`
	LastName       string `json:"name_last"`
	NameJapanese   string `json:"name_japanese"`
	ImageURLMedium string `json:"image_url_med"`
	ImageURLLarge  string `json:"image_url_lge"`
	Role           string `json:"role"`
}

type CharacterSmall

type CharacterSmall struct {
	Id             int    `json:"id"`
	FirstName      string `json:"name_first"`
	LastName       string `json:"name_last"`
	ImageURLMedium string `json:"image_url_med"`
	ImageURLLarge  string `json:"image_url_lge"`
	Role           string `json:"role"`
}

type Error

type Error struct {
	Status   int      `json:"status"`
	Messages []string `json:"messages"`
}

func UnmarshalErrorResponse

func UnmarshalErrorResponse(response []byte) (result Error)

func (Error) Error

func (e Error) Error() string

type Session

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

func NewSession

func NewSession(clientId, clientSecret string) (s *Session, err error)

func (*Session) Auth

func (s *Session) Auth() (err error)

Auth retrieves a new access token.

func (*Session) GetAnime

func (s *Session) GetAnime(id int) (result *Anime, err error)

func (*Session) IsExpired

func (s *Session) IsExpired() bool

IsExpired returns true if the session expired.

func (*Session) NewRequest

func (s *Session) NewRequest(method, urlStr string, body io.Reader) (req *http.Request, err error)

func (*Session) SearchAnime

func (s *Session) SearchAnime(terms string) (results []*AnimeSmall, err error)

func (*Session) SearchCharacter

func (s *Session) SearchCharacter(terms string) (results []*CharacterSmall, err error)

Jump to

Keyboard shortcuts

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