jikan-go: github.com/darenliang/jikan-go Index | Files

package jikan

import "github.com/darenliang/jikan-go"

Index

Package Files

anime.go character.go club.go config.go genre.go jikan.go magazine.go manga.go meta.go person.go process.go producer.go schedule.go search.go season.go top.go user.go

Constants

const ClientTimeout = 20

ClientTimeout specifies the timeout value in seconds of the http client You might want to increase this number if you have a slow connection

const Endpoint = "https://api.jikan.moe/v3"

Endpoint points to Jikan API

func PrettyPrint Uses

func PrettyPrint(val interface{})

PrettyPrint pretty prints an interface value

type Anime Uses

type Anime struct {
    ID      int    // MyAnimeList anime ID
    Request string // request type (optional)
    Page    int    // page number (available depending on request type)
}

Anime struct defines an anime

func (Anime) Get Uses

func (anime Anime) Get() (map[string]interface{}, error)

Get returns a map of an anime as specified in the Anime struct Calls responses through the /anime/ endpoint

type Character Uses

type Character struct {
    ID      int    // MyAnimeList character ID
    Request string // request type (optional)
}

Character struct defines a character

func (Character) Get Uses

func (character Character) Get() (map[string]interface{}, error)

Get returns a map of a character as specified in the Character struct Calls responses through the /character/ endpoint

type Club Uses

type Club struct {
    ID      int    // MyAnimeList club ID
    Request string // request type
    Page    int    // page number (available upon request type activation)
}

Club struct defines a club

func (Club) Get Uses

func (club Club) Get() (map[string]interface{}, error)

Get returns a map of a club as specified in the Club struct Calls responses through the /club/ endpoint

type Genre Uses

type Genre struct {
    Type    string // media type
    GenreID int    // MyAnimeList genre ID
    Page    int    // page number (optional)
}

Genre struct defines a genre

func (Genre) Get Uses

func (genre Genre) Get() (map[string]interface{}, error)

Get returns a map of a genre as specified in the Genre struct Calls responses through the /genre/ endpoint

type Magazine Uses

type Magazine struct {
    MagazineID int // MyAnimeList magazine ID
    Page       int // page number (optional)
}

Magazine struct defines a magazine

func (Magazine) Get Uses

func (magazine Magazine) Get() (map[string]interface{}, error)

Get returns a map of a magazine as specified in the Magazine struct Calls responses through the /magazine/ endpoint

type Mal Uses

type Mal interface {
    Get() (map[string]interface{}, error) // get Jikan data as a map
}

Mal is an interface that gets the specified Jikan json map

type Manga Uses

type Manga struct {
    ID      int    // MyAnimeList manga ID
    Request string // request type (optional)
    Page    int    // page number (available depending on request type)
}

Manga struct defines a manga

func (Manga) Get Uses

func (manga Manga) Get() (map[string]interface{}, error)

Get returns a map of a manga as specified in the Manga struct Calls responses through the /manga/ endpoint

type Meta Uses

type Meta struct {
    Request string // request type
    Type    string // object Type
    Period  string // request Period
    Offset  int    // page number (optional)
}

Meta struct defines a meta

func (Meta) Get Uses

func (meta Meta) Get() (map[string]interface{}, error)

Get returns a map of a meta as specified in the Meta struct Calls responses through the /meta/ endpoint

type Person Uses

type Person struct {
    ID      int    // MyAnimeList person ID
    Request string // request type (optional)
}

Person struct defines a person

func (Person) Get Uses

func (person Person) Get() (map[string]interface{}, error)

Get returns a map of a person as specified in the Person struct Calls responses through the /person/ endpoint

type Producer Uses

type Producer struct {
    ProducerID int // MyAnimeList producer ID
    Page       int // page number (optional)
}

Producer struct defines a producer

func (Producer) Get Uses

func (producer Producer) Get() (map[string]interface{}, error)

Get returns a map of a producer as specified in the Producer struct Calls responses through the /producer/ endpoint

type Schedule Uses

type Schedule struct {
    Day string // day of the week
}

Schedule struct defines a producer

func (Schedule) Get Uses

func (schedule Schedule) Get() (map[string]interface{}, error)

Get returns a map of a schedule as specified in the Schedule struct Calls responses through the /schedule/ endpoint

type Search struct {
    Type string // object type

    // All below are optional
    Q            string  // search query
    Page         int     // page number
    TypeFormat   string  // media format
    Status       string  // status
    Rated        string  // age rating
    Genre        int     // MyAnimeList genre ID
    Score        float64 // score 0.0 - 10.0
    StartDate    string  // start date
    EndDate      string  // end date
    GenreExclude bool    // exclude genre filter
    Limit        int     // limit results
    OrderBy      string  // order by
    Sort         string  // sort
    Producer     int     // MyAnimeList producer ID
    Magazine     int     // MyAnimeList magazine ID
    Letter       rune    // starting letter
}

Search struct defines an search

func (Search) Get Uses

func (search Search) Get() (map[string]interface{}, error)

Get returns a map of an search as specified in the Search struct Calls responses through the /search/ endpoint

type Season Uses

type Season struct {
    Year   int    // year
    Season string // season
}

Season struct defines a season

func (Season) Get Uses

func (season Season) Get() (map[string]interface{}, error)

Get returns a map of a season as specified in the Season struct Calls responses through the /season/ endpoint

func (Season) GetArchive Uses

func (season Season) GetArchive() (map[string]interface{}, error)

GetArchive returns a map of season archives Calls responses through the /season/archive endpoint An empty Season struct is allowed

func (Season) GetLater Uses

func (season Season) GetLater() (map[string]interface{}, error)

GetLater returns a map of a list of anime from seasons later Calls responses through the /season/archive endpoint An empty Season struct is allowed

type Top Uses

type Top struct {
    Type    string // object type
    Page    int    // page number (optional)
    Subtype string // subtype (available upon page specification)
}

Top struct defines a top

func (Top) Get Uses

func (top Top) Get() (map[string]interface{}, error)

Get returns a map of a top as specified in the Top struct Calls responses through the /top/ endpoint

type User Uses

type User struct {
    Username string // MyAnimeList username
    Request  int    // request type
    Data     string // specify data type

    // Use only when choosing history
    HistoryType string // specify history type

    // Use only when choosing friends
    FriendsPage int // specify friends page

    AnimeListFilter string // anime List Filter
    MangaListFilter string // manga List Filter

    // Use only when choosing animelist or mangalist (Only need to choose what you need)
    Search string // search query
    Page   int    // page number
    Sort   string // sort

    // Only for AnimeListFilter
    OrderBy      string // rrder by
    OrderBy2     string // second order by
    AiredFrom    string // aired from
    AiredTo      string // aired to
    Producer     int    // MyAnimeList producer ID
    Year         int    // year
    Season       string // season
    AiringStatus string // airing status

    // Only for MangaListFilter
    PublishedFrom    string // published from
    PublishedTo      string // published to
    Magazine         int    // MyAnimeList magazine ID
    PublishingStatus string // publishing status
}

User struct defines a user

func (User) Get Uses

func (user User) Get() (map[string]interface{}, error)

Get returns a map of a user as specified in the User struct Calls responses through the /user/ endpoint

Package jikan imports 7 packages (graph). Updated 2019-11-11. Refresh now. Tools for package owners.