shikimori

package module
v0.0.0-...-dd1392d Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 10 Imported by: 0

README

shikimori

PkgGoDev codecov release license

Status - https://github.com/SevereCloud/shikimori/milestone/1

package main

import (
	"context"
	"log"

	"github.com/SevereCloud/shikimori"
)

func main() {
	shiki := shikimori.NewAPI()

	// shiki.UserAgent = "MyUserAgent"
	// shiki.AccessToken = os.Getenv("ACCESS_TOKEN")

	ctx := context.Background()

	resp, err := shiki.UsersAnimeRates(ctx, "SevereCloud", &shikimori.UsersAnimeRateParams{
		Limit:  1,
		Status: shikimori.Watching,
	})
	if err != nil {
		log.Fatal(err)
	}

	log.Println(resp[0].Anime.Name)
}

Documentation

Overview

Package shikimori

Authentication

OAuth2 is used for authentication. OAuth2 guide.

Restrictions

API access is limited by `5rps` and `90rpm`.

Requirements

Add your Oauth2 Application name to [API.UserAgent] requests header. Don’t mimic a browser. Your IP address may be banned if you use API without properly set [API.UserAgent] header.

Pagination in API

When you request N elements from paginated API, you will get N+1 results if API has next page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Client      *http.Client
	BaseURL     string
	UserAgent   string
	AccessToken string
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI() *API

func (*API) Achievements

func (s *API) Achievements(ctx context.Context, params *AchievementsParams) (resp []Achievement, err error)

Achievements return list user achievements.

func (*API) Anime

func (s *API) Anime(ctx context.Context, id int, params *AnimeParams) (resp AnimeFull, err error)
func (s *API) AnimeExternalLinks(
	ctx context.Context, id int, params *AnimeExternalLinksParams,
) (resp []ExternalLink, err error)

func (*API) AnimeFranchise

func (s *API) AnimeFranchise(ctx context.Context, id int, params *AnimeFranchiseParams) (
	resp Franchise,
	err error,
)

func (*API) AnimeRelated

func (s *API) AnimeRelated(ctx context.Context, id int, params *AnimeRelatedParams) (resp []AnimeRelated, err error)

func (*API) AnimeRoles

func (s *API) AnimeRoles(
	ctx context.Context, id int, params *AnimeRolesParams,
) (resp []AnimeRole, err error)

func (*API) AnimeScreenshots

func (s *API) AnimeScreenshots(
	ctx context.Context, id int, params *AnimeScreenshotsParams,
) (resp []Screenshot, err error)

func (*API) AnimeSimilar

func (s *API) AnimeSimilar(ctx context.Context, id int, params *AnimeSimilarParams) (resp []Anime, err error)

func (*API) AnimeTopics

func (s *API) AnimeTopics(
	ctx context.Context, id int, params *AnimeTopicsParams,
) (resp []Topic, err error)

func (*API) Animes

func (s *API) Animes(ctx context.Context, params *AnimesParams) (resp []Anime, err error)

func (*API) Bans

func (s *API) Bans(ctx context.Context, params *BansParams) (resp []Ban, err error)

func (*API) Calendar

func (s *API) Calendar(ctx context.Context, params *CalendarParams) (resp []CalendarItem, err error)

func (*API) Character

func (s *API) Character(ctx context.Context, id int, params *CharacterParams) (resp Character, err error)

func (*API) ConstantsAnime

func (s *API) ConstantsAnime(ctx context.Context, params *ConstantsAnimeParams) (resp ConstantsAnime, err error)

func (*API) ConstantsClub

func (s *API) ConstantsClub(
	ctx context.Context, params *ConstantsClubParams,
) (resp ConstantsClub, err error)

func (*API) ConstantsManga

func (s *API) ConstantsManga(ctx context.Context, params *ConstantsMangaParams) (resp ConstantsManga, err error)

func (*API) ConstantsSmileys

func (s *API) ConstantsSmileys(
	ctx context.Context, params *ConstantsSmileysParams,
) (resp []ConstantsSmiley, err error)

func (*API) ConstantsUserRate

func (s *API) ConstantsUserRate(
	ctx context.Context, params *ConstantsUserRateParams,
) (resp ConstantsUserRate, err error)

func (*API) Forums

func (s *API) Forums(ctx context.Context, params *ForumsParams) (resp []Forum, err error)

func (*API) Genres

func (s *API) Genres(ctx context.Context, params *GenresParams) (resp []Genre, err error)

func (*API) Manga

func (s *API) Manga(ctx context.Context, id int, params *MangaParams) (resp MangaFull, err error)
func (s *API) MangaExternalLinks(
	ctx context.Context, id int, params *MangaExternalLinksParams,
) (resp []ExternalLink, err error)

func (*API) MangaFranchise

func (s *API) MangaFranchise(ctx context.Context, id int, params *MangaFranchiseParams) (
	resp Franchise,
	err error,
)

func (*API) MangaRelated

func (s *API) MangaRelated(ctx context.Context, id int, params *MangaRelatedParams) (resp []MangaRelated, err error)

func (*API) MangaRoles

func (s *API) MangaRoles(
	ctx context.Context, id int, params *MangaRolesParams,
) (resp []MangaRole, err error)

func (*API) MangaSimilar

func (s *API) MangaSimilar(ctx context.Context, id int, params *MangaSimilarParams) (resp []Manga, err error)

func (*API) MangaTopics

func (s *API) MangaTopics(
	ctx context.Context, id int, params *MangaTopicsParams,
) (resp []Topic, err error)

func (*API) People

func (s *API) People(ctx context.Context, id int, params *PeopleParams) (resp Person, err error)

func (*API) Publishers

func (s *API) Publishers(ctx context.Context, params *PublishersParams) (resp []Publisher, err error)

func (*API) Ranobe

func (s *API) Ranobe(ctx context.Context, id int, params *RanobeParams) (resp RanobeFull, err error)
func (s *API) RanobeExternalLinks(ctx context.Context, id int, params *RanobeExternalLinksParams) (
	resp []ExternalLink,
	err error,
)

func (*API) RanobeFranchise

func (s *API) RanobeFranchise(ctx context.Context, id int, params *RanobeFranchiseParams) (
	resp Franchise,
	err error,
)

func (*API) RanobeRelated

func (s *API) RanobeRelated(ctx context.Context, id int, params *RanobeRelatedParams) (
	resp []RanobeRelated,
	err error,
)

func (*API) RanobeRoles

func (s *API) RanobeRoles(
	ctx context.Context, id int, params *RanobeRolesParams,
) (resp []RanobeRole, err error)

func (*API) RanobeSimilar

func (s *API) RanobeSimilar(ctx context.Context, id int, params *RanobeSimilarParams) (resp []Ranobe, err error)

func (*API) RanobeTopics

func (s *API) RanobeTopics(
	ctx context.Context, id int, params *RanobeTopicsParams,
) (resp []Topic, err error)

func (*API) StatsActiveUsers

func (s *API) StatsActiveUsers(ctx context.Context, params *StatsActiveUsersParams) (resp []int, err error)

func (*API) Studios

func (s *API) Studios(ctx context.Context, params *StudiosParams) (resp []Studio, err error)

func (*API) TopicsHot

func (s *API) TopicsHot(ctx context.Context, params *TopicsHotParams) (resp []Topic, err error)

func (*API) TopicsUpdates

func (s *API) TopicsUpdates(ctx context.Context, params *TopicsUpdatesParams) (resp []TopicsUpdate, err error)

func (*API) UserRate

func (s *API) UserRate(ctx context.Context, id int, params *UserRateParams) (resp UserRate, err error)

func (*API) UserRates

func (s *API) UserRates(ctx context.Context, params *UserRatesParams) (resp []UserRate, err error)

func (*API) UsersAnimeRates

func (s *API) UsersAnimeRates(
	ctx context.Context, id int, params *UsersAnimeRateParams,
) (resp []UsersAnimeRate, err error)

func (*API) Video

func (s *API) Video(ctx context.Context, id int, params *VideoParams) (resp []Video, err error)

type Achievement

type Achievement struct {
	ID        int       `json:"id"`
	NekoID    string    `json:"neko_id"`
	Level     int       `json:"level"`
	Progress  int       `json:"progress"`
	UserID    int       `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AchievementsParams

type AchievementsParams struct {
	UserID int `json:"user_id"`
}

type Anime

type Anime struct {
	ID            int     `json:"id"`
	Name          string  `json:"name"`
	Russian       string  `json:"russian"`
	Image         Image   `json:"image"`
	URL           string  `json:"url"`
	Kind          *string `json:"kind,omitempty"`
	Score         string  `json:"score"`
	Status        string  `json:"status"`
	Episodes      int     `json:"episodes"`
	EpisodesAired int     `json:"episodes_aired"`
	AiredOn       *string `json:"aired_on,omitempty"`
	ReleasedOn    *string `json:"released_on,omitempty"`
}

type AnimeDuration

type AnimeDuration string
const (
	// Less than 10 minutes.
	AnimeDurationsS AnimeDuration = "S"
	// Less than 30 minutes.
	AnimeDurationsD AnimeDuration = "D"
	// More than 30 minutes.
	AnimeDurationsF AnimeDuration = "F"
)

type AnimeExternalLinksParams

type AnimeExternalLinksParams struct{}

type AnimeFranchiseParams

type AnimeFranchiseParams struct{}

type AnimeFull

type AnimeFull struct {
	Anime

	Rating             string              `json:"rating"`
	English            []string            `json:"english"`
	Japanese           []string            `json:"japanese"`
	Synonyms           []string            `json:"synonyms"`
	LicenseNameRu      *string             `json:"license_name_ru,omitempty"`
	Duration           int                 `json:"duration"`
	Description        *string             `json:"description,omitempty"`
	DescriptionHTML    string              `json:"description_html"`
	DescriptionSource  *string             `json:"description_source,omitempty"`
	Franchise          *string             `json:"franchise,omitempty"`
	Favoured           bool                `json:"favoured"`
	Anons              bool                `json:"anons"`
	Ongoing            bool                `json:"ongoing"`
	ThreadID           *int                `json:"thread_id,omitempty"`
	TopicID            *int                `json:"topic_id,omitempty"`
	MyanimelistID      int                 `json:"myanimelist_id"`
	RatesScoresStats   []RatesScoresStat   `json:"rates_scores_stats"`
	RatesStatusesStats []RatesStatusesStat `json:"rates_statuses_stats"`
	UpdatedAt          time.Time           `json:"updated_at"`
	NextEpisodeAt      *time.Time          `json:"next_episode_at,omitempty"`
	Fansubbers         []string            `json:"fansubbers"`
	Fandubbers         []string            `json:"fandubbers"`
	Licensors          []string            `json:"licensors"`
	Genres             []Genre             `json:"genres"`
	Studios            []Studio            `json:"studios"`
	Videos             []Video             `json:"videos"`
	Screenshots        []Screenshot        `json:"screenshots"`
	UserRate           *UserRate           `json:"user_rate,omitempty"`
}

type AnimeImage

type AnimeImage struct {
	Original string `json:"original"`
	Preview  string `json:"preview"`
	X96      string `json:"x96"`
	X48      string `json:"x48"`
}

type AnimeKind

type AnimeKind string
const (
	AnimeKindTv      AnimeKind = "tv"
	AnimeKindMovie   AnimeKind = "movie"
	AnimeKindOva     AnimeKind = "ova"
	AnimeKindOna     AnimeKind = "ona"
	AnimeKindSpecial AnimeKind = "special"
	AnimeKindMusic   AnimeKind = "music"
	// TV13, TV24 and TV48 used in AnimesParams.
	AnimeKindTV13 AnimeKind = "tv_13"
	AnimeKindTV24 AnimeKind = "tv_24"
	AnimeKindTV48 AnimeKind = "tv_48"
)

type AnimeMyList

type AnimeMyList string
const (
	AnimeMyListPlanned    AnimeMyList = "planned"
	AnimeMyListWatching   AnimeMyList = "watching"
	AnimeMyListRewatching AnimeMyList = "rewatching"
	AnimeMyListCompleted  AnimeMyList = "completed"
	AnimeMyListOnHold     AnimeMyList = "on_hold"
	AnimeMyListDropped    AnimeMyList = "dropped"
)

type AnimeOrder

type AnimeOrder string
const (
	AnimeOrderID            AnimeOrder = "id"
	AnimeOrderIDDesc        AnimeOrder = "id_desc"
	AnimeOrderRanked        AnimeOrder = "ranked"
	AnimeOrderKind          AnimeOrder = "kind"
	AnimeOrderPopularity    AnimeOrder = "popularity"
	AnimeOrderName          AnimeOrder = "name"
	AnimeOrderAiredOn       AnimeOrder = "aired_on"
	AnimeOrderEpisodes      AnimeOrder = "episodes"
	AnimeOrderStatus        AnimeOrder = "status"
	AnimeOrderRandom        AnimeOrder = "random"
	AnimeOrderCreatedAt     AnimeOrder = "created_at"
	AnimeOrderCreatedAtDesc AnimeOrder = "created_at_desc"
)

type AnimeParams

type AnimeParams struct{}

type AnimeRating

type AnimeRating string
const (
	// No rating.
	AnimeRatingNone AnimeRating = "none"
	// All ages.
	AnimeRatingG AnimeRating = "g"
	// Children.
	AnimeRatingPG AnimeRating = "pg"
	// Teens 13 or older.
	AnimeRatingPG13 AnimeRating = "pg_13"
	// Recommended (violence & profanity).
	AnimeRatingR AnimeRating = "r"
	// Mild Nudity (may also contain violence & profanity).
	AnimeRatingRPlus AnimeRating = "r_plus"
	// Hentai (extreme sexual content/nudity).
	AnimeRatingRX AnimeRating = "rx"
)

type AnimeRelated

type AnimeRelated struct {
	Relation        string      `json:"relation"`
	RelationRussian string      `json:"relation_russian"`
	Anime           Anime       `json:"anime"`
	Manga           interface{} `json:"manga"`
}

type AnimeRelatedParams

type AnimeRelatedParams struct{}

type AnimeRole

type AnimeRole struct {
	Roles        []string       `json:"roles"`
	RolesRussian []string       `json:"roles_russian"`
	Character    *CharacterBase `json:"character"`
	Person       *PersonBase    `json:"person"`
}

type AnimeRolesParams

type AnimeRolesParams struct{}

type AnimeScreenshotsParams

type AnimeScreenshotsParams struct{}

type AnimeSimilarParams

type AnimeSimilarParams struct{}

type AnimeStatus

type AnimeStatus string
const (
	AnimeStatusAnons    AnimeStatus = "anons"
	AnimeStatusOngoing  AnimeStatus = "ongoing"
	AnimeStatusReleased AnimeStatus = "released"
)

type AnimeTopicsParams

type AnimeTopicsParams struct{}

type AnimesParams

type AnimesParams struct {
	// Must be a number between 1 and 100000.
	Page int `json:"page,omitempty"`

	// 50 maximum. Must be a number.
	Limit int `json:"limit,omitempty"`

	// Must be one of: id, id_desc, ranked, kind, popularity, name,
	// aired_on, episodes, status, random, ranked_random,
	// ranked_shiki, created_at, created_at_desc.
	Order AnimeOrder `json:"order,omitempty"`

	// Must be one of: tv, movie, ova, ona, special, music, tv_13, tv_24, tv_48.
	Kind AnimeKind `json:"kind,omitempty"`

	// Must be one of: anons, ongoing, released.
	Status AnimeStatus `json:"status,omitempty"`

	// Examples: summer_2017, 2016, 2014_2016, 199x.
	Season string `json:"season,omitempty"`

	// Minimal anime score. Must be a number.
	Score int `json:"score,omitempty"`

	// Must be one of: S, D, F.
	Duration AnimeDuration `json:"duration,omitempty"`

	// Must be one of: none, g, pg, pg_13, r, r_plus, rx.
	Rating AnimeRating `json:"rating,omitempty"`

	// List of genre ids separated by comma.
	Genre string `json:"genre,omitempty"`

	// List of studio ids separated by comma.
	Studio string `json:"studio,omitempty"`

	// List of franchises separated by comma.
	Franchise string `json:"franchise,omitempty"`

	// Set to false to allow hentai, yaoi and yuri. Must be one of: true, false.
	Censored bool `json:"censored,omitempty"`

	// Status of manga in current user list.
	// Must be one of: planned, watching, rewatching, completed, on_hold, dropped.
	MyList AnimeMyList `json:"mylist,omitempty"`

	// List of anime ids separated by comma.
	IDs string `json:"ids,omitempty"`

	// List of anime ids separated by comma.
	ExcludeIDs string `json:"exclude_ids,omitempty"`

	// Search phrase to filter animes by name. Must be a String.
	Search string `json:"search,omitempty"`
}

type Ban

type Ban struct {
	ID              int       `json:"id"`
	UserID          int       `json:"user_id"`
	Comment         *Comment  `json:"comment,omitempty"`
	ModeratorID     int       `json:"moderator_id"`
	Reason          string    `json:"reason"`
	CreatedAt       time.Time `json:"created_at"`
	DurationMinutes int       `json:"duration_minutes"`
	User            User      `json:"user"`
	Moderator       User      `json:"moderator"`
}

type BansParams

type BansParams struct {
	Page  int `json:"page,omitempty"`
	Limit int `json:"limit,omitempty"`
}

Undocumented params for /api/bans See: https://github.com/shikimori/shikimori/blob/master/app/controllers/api/v1/bans_controller.rb Page constraints: From 1 to ... Limit constraints: From 1 to 30.

type CalendarItem

type CalendarItem struct {
	NextEpisode   int       `json:"next_episode"`
	NextEpisodeAt time.Time `json:"next_episode_at"`
	Duration      *int      `json:"duration,omitempty"`
	Anime         Anime     `json:"anime"`
}

type CalendarParams

type CalendarParams struct {
	// Set to true to discard hentai, yaoi and yuri
	Censored bool `json:"censored,omitempty"`
}

type Character

type Character struct {
	CharacterBase
	Altname           string           `json:"altname"`
	Japanese          string           `json:"japanese"`
	Description       *string          `json:"description"`
	DescriptionHTML   string           `json:"description_html"`
	DescriptionSource *string          `json:"description_source"`
	Favoured          bool             `json:"favoured"`
	ThreadID          *int             `json:"thread_id"`
	TopicID           *int             `json:"topic_id"`
	UpdatedAt         time.Time        `json:"updated_at"`
	Seyu              []PersonBase     `json:"seyu"`
	Animes            []CharacterAnime `json:"animes"`
	Mangas            []interface{}    `json:"mangas"`
}

type CharacterAnime

type CharacterAnime struct {
	Anime
	Roles []string `json:"roles"`
	Role  string   `json:"role"`
}

type CharacterBase

type CharacterBase struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Russian string `json:"russian"`
	Image   Image  `json:"image"`
	URL     string `json:"url"`
}

type CharacterParams

type CharacterParams struct{}

type ClubCommentPolicy

type ClubCommentPolicy string
const (
	ClubCommentPolicyFree    ClubCommentPolicy = "free"
	ClubCommentPolicyMembers ClubCommentPolicy = "members"
	ClubCommentPolicyAdmins  ClubCommentPolicy = "admins"
)

type ClubImageUploadPolicy

type ClubImageUploadPolicy string
const (
	ClubImageUploadPolicyMembers ClubImageUploadPolicy = "members"
	ClubImageUploadPolicyAdmins  ClubImageUploadPolicy = "admins"
)

type ClubJoinPolicy

type ClubJoinPolicy string
const (
	ClubJoinPolicyFree         ClubJoinPolicy = "free"
	ClubJoinPolicyMemberInvite ClubJoinPolicy = "member_invite"
	ClubJoinPolicyAdminInvite  ClubJoinPolicy = "admin_invite"
	ClubJoinPolicyOwnerInvite  ClubJoinPolicy = "owner_invite"
)

type Comment

type Comment struct {
	ID              int       `json:"id"`
	CommentableID   int       `json:"commentable_id"`
	CommentableType string    `json:"commentable_type"`
	Body            string    `json:"body"`
	UserID          int       `json:"user_id"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	IsOfftopic      bool      `json:"is_offtopic"`
}

type ConstantsAnime

type ConstantsAnime struct {
	Kind   []AnimeKind   `json:"kind"`
	Status []AnimeStatus `json:"status"`
}

type ConstantsAnimeParams

type ConstantsAnimeParams struct{}

type ConstantsClub

type ConstantsClub struct {
	JoinPolicy        []ClubJoinPolicy        `json:"join_policy"`
	CommentPolicy     []ClubCommentPolicy     `json:"comment_policy"`
	ImageUploadPolicy []ClubImageUploadPolicy `json:"image_upload_policy"`
}

type ConstantsClubParams

type ConstantsClubParams struct{}

type ConstantsManga

type ConstantsManga struct {
	Kind   []MangaKind   `json:"kind"`
	Status []MangaStatus `json:"status"`
}

type ConstantsMangaParams

type ConstantsMangaParams struct{}

type ConstantsSmiley

type ConstantsSmiley struct {
	Bbcode string `json:"bbcode"`
	Path   string `json:"path"`
}

type ConstantsSmileysParams

type ConstantsSmileysParams struct{}

type ConstantsUserRate

type ConstantsUserRate struct {
	Status []UserRateStatus `json:"status"`
}

type ConstantsUserRateParams

type ConstantsUserRateParams struct{}
type ExternalLink struct {
	ID         *int       `json:"id,omitempty"`
	Kind       string     `json:"kind"`
	URL        string     `json:"url"`
	Source     string     `json:"source"`
	EntryID    int        `json:"entry_id"`
	EntryType  string     `json:"entry_type"`
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	UpdatedAt  *time.Time `json:"updated_at,omitempty"`
	ImportedAt *time.Time `json:"imported_at,omitempty"`
}

type Forum

type Forum struct {
	ID        int    `json:"id"`
	Position  int    `json:"position"`
	Name      string `json:"name"`
	Permalink string `json:"permalink"`
	URL       string `json:"url"`
}

type ForumsParams

type ForumsParams struct{}

type Franchise

type Franchise struct {
	Links     []FranchiseLink `json:"links"`
	Nodes     []FranchiseNode `json:"nodes"`
	CurrentID int             `json:"current_id"`
}
type FranchiseLink struct {
	ID       int    `json:"id"`
	SourceID int    `json:"source_id"`
	TargetID int    `json:"target_id"`
	Source   int    `json:"source"`
	Target   int    `json:"target"`
	Weight   int    `json:"weight"`
	Relation string `json:"relation"`
}

type FranchiseNode

type FranchiseNode struct {
	ID       int     `json:"id"`
	Date     int     `json:"date"`
	Name     string  `json:"name"`
	ImageURL string  `json:"image_url"`
	URL      string  `json:"url"`
	Year     *int    `json:"year"`
	Kind     *string `json:"kind"`
	Weight   int     `json:"weight"`
}

type Genre

type Genre struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Russian string `json:"russian"`
	Kind    string `json:"kind"`
}

type GenresParams

type GenresParams struct{}

type Image

type Image struct {
	Original string `json:"original"`
	Preview  string `json:"preview"`
	X96      string `json:"x96"`
	X48      string `json:"x48"`
}

type Manga

type Manga struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Russian    string `json:"russian"`
	Image      Image  `json:"image"`
	URL        string `json:"url"`
	Kind       string `json:"kind"`
	Score      string `json:"score"`
	Status     string `json:"status"`
	Volumes    int    `json:"volumes"`
	Chapters   int    `json:"chapters"`
	AiredOn    string `json:"aired_on"`
	ReleasedOn string `json:"released_on"`
}

type MangaExternalLinksParams

type MangaExternalLinksParams struct{}

type MangaFranchiseParams

type MangaFranchiseParams struct{}

type MangaFull

type MangaFull struct {
	Manga

	English            []string            `json:"english"`
	Japanese           []string            `json:"japanese"`
	Synonyms           []string            `json:"synonyms"`
	LicenseNameRu      *string             `json:"license_name_ru"`
	Description        string              `json:"description"`
	DescriptionHTML    string              `json:"description_html"`
	DescriptionSource  *string             `json:"description_source"`
	Franchise          *string             `json:"franchise"`
	Favoured           bool                `json:"favoured"`
	Anons              bool                `json:"anons"`
	Ongoing            bool                `json:"ongoing"`
	ThreadID           *int                `json:"thread_id"`
	TopicID            *int                `json:"topic_id"`
	MyanimelistID      int                 `json:"myanimelist_id"`
	RatesScoresStats   []RatesScoresStat   `json:"rates_scores_stats"`
	RatesStatusesStats []RatesStatusesStat `json:"rates_statuses_stats"`
	Licensors          []string            `json:"licensors"`
	Genres             []Genre             `json:"genres"`
	Publishers         []Publisher         `json:"publishers"`
	UserRate           *UserRate           `json:"user_rate"`
}

type MangaKind

type MangaKind string
const (
	MangaKindManga      MangaKind = "manga"
	MangaKindManhwa     MangaKind = "manhwa"
	MangaKindManhua     MangaKind = "manhua"
	MangaKindLightNovel MangaKind = "light_novel"
	MangaKindNovel      MangaKind = "novel"
	MangaKindOneShot    MangaKind = "one_shot"
	MangaKindDoujin     MangaKind = "doujin"
)

type MangaParams

type MangaParams struct{}

type MangaRelated

type MangaRelated struct {
	Relation        string      `json:"relation"`
	RelationRussian string      `json:"relation_russian"`
	Anime           Anime       `json:"anime"`
	Manga           interface{} `json:"manga"`
}

type MangaRelatedParams

type MangaRelatedParams struct{}

type MangaRole

type MangaRole struct {
	Roles        []string       `json:"roles"`
	RolesRussian []string       `json:"roles_russian"`
	Character    *CharacterBase `json:"character"`
	Person       *PersonBase    `json:"person"`
}

type MangaRolesParams

type MangaRolesParams struct{}

type MangaSimilarParams

type MangaSimilarParams struct{}

type MangaStatus

type MangaStatus string
const (
	MangaStatusAnons        MangaStatus = "anons"
	MangaStatusOngoing      MangaStatus = "ongoing"
	MangaStatusReleased     MangaStatus = "released"
	MangaStatusPaused       MangaStatus = "paused"
	MangaStatusDiscontinued MangaStatus = "discontinued"
)

type MangaTopicsParams

type MangaTopicsParams struct{}

type NotFoundError

type NotFoundError struct{}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type PeopleParams

type PeopleParams struct{}

type Person

type Person struct {
	PersonBase
	Japanese         string       `json:"japanese"`
	JobTitle         string       `json:"job_title"`
	BirthOn          PersonDate   `json:"birth_on"`
	DeceasedOn       PersonDate   `json:"deceased_on"`
	Website          string       `json:"website"`
	GrouppedRoles    []RoleStat   `json:"groupped_roles"`
	Roles            []PersonRole `json:"roles"`
	Works            []PersonWork `json:"works"`
	TopicID          int          `json:"topic_id"`
	PersonFavoured   bool         `json:"person_favoured"`
	Producer         bool         `json:"producer"`
	ProducerFavoured bool         `json:"producer_favoured"`
	Mangaka          bool         `json:"mangaka"`
	MangakaFavoured  bool         `json:"mangaka_favoured"`
	Seyu             bool         `json:"seyu"`
	SeyuFavoured     bool         `json:"seyu_favoured"`
	UpdatedAt        time.Time    `json:"updated_at"`
	ThreadID         int          `json:"thread_id"`
	Birthday         PersonDate   `json:"birthday"`
}

type PersonBase

type PersonBase struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Russian string `json:"russian"`
	Image   Image  `json:"image"`
	URL     string `json:"url"`
}

type PersonCharacter

type PersonCharacter struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Russian string `json:"russian"`
	Image   Image  `json:"image"`
	URL     string `json:"url"`
}

type PersonDate

type PersonDate struct {
	Day   int `json:"day"`
	Month int `json:"month"`
	Year  int `json:"year"`
}

type PersonRole

type PersonRole struct {
	Characters []PersonCharacter `json:"characters"`
	Animes     []Anime           `json:"animes"`
}

type PersonWork

type PersonWork struct {
	Anime Anime       `json:"anime"`
	Manga interface{} `json:"manga"`
	Role  string      `json:"role"`
}

type Publisher

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

type PublishersParams

type PublishersParams struct{}

type Ranobe

type Ranobe struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Russian    string `json:"russian"`
	Image      Image  `json:"image"`
	URL        string `json:"url"`
	Kind       string `json:"kind"`
	Score      string `json:"score"`
	Status     string `json:"status"`
	Volumes    int    `json:"volumes"`
	Chapters   int    `json:"chapters"`
	AiredOn    string `json:"aired_on"`
	ReleasedOn string `json:"released_on"`
}

type RanobeExternalLinksParams

type RanobeExternalLinksParams struct{}

type RanobeFranchiseParams

type RanobeFranchiseParams struct{}

type RanobeFull

type RanobeFull struct {
	Ranobe

	English            []string            `json:"english"`
	Japanese           []string            `json:"japanese"`
	Synonyms           []string            `json:"synonyms"`
	LicenseNameRu      *string             `json:"license_name_ru"`
	Description        string              `json:"description"`
	DescriptionHTML    string              `json:"description_html"`
	DescriptionSource  *string             `json:"description_source"`
	Franchise          *string             `json:"franchise"`
	Favoured           bool                `json:"favoured"`
	Anons              bool                `json:"anons"`
	Ongoing            bool                `json:"ongoing"`
	ThreadID           *int                `json:"thread_id"`
	TopicID            *int                `json:"topic_id"`
	MyanimelistID      int                 `json:"myanimelist_id"`
	RatesScoresStats   []RatesScoresStat   `json:"rates_scores_stats"`
	RatesStatusesStats []RatesStatusesStat `json:"rates_statuses_stats"`
	Licensors          []string            `json:"licensors"`
	Genres             []Genre             `json:"genres"`
	Publishers         []Publisher         `json:"publishers"`
	UserRate           *UserRate           `json:"user_rate"`
}

type RanobeParams

type RanobeParams struct{}

type RanobeRelated

type RanobeRelated struct {
	Relation        string      `json:"relation"`
	RelationRussian string      `json:"relation_russian"`
	Anime           Anime       `json:"anime"`
	Manga           interface{} `json:"manga"`
}

type RanobeRelatedParams

type RanobeRelatedParams struct{}

type RanobeRole

type RanobeRole struct {
	Roles        []string       `json:"roles"`
	RolesRussian []string       `json:"roles_russian"`
	Character    *CharacterBase `json:"character"`
	Person       *PersonBase    `json:"person"`
}

type RanobeRolesParams

type RanobeRolesParams struct{}

type RanobeSimilarParams

type RanobeSimilarParams struct{}

type RanobeTopicsParams

type RanobeTopicsParams struct{}

type RatesScoresStat

type RatesScoresStat struct {
	Name  int `json:"name"`
	Value int `json:"value"`
}

type RatesStatusesStat

type RatesStatusesStat struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

type RoleStat

type RoleStat struct {
	Name  string
	Count int
}

func (*RoleStat) UnmarshalJSON

func (r *RoleStat) UnmarshalJSON(data []byte) error

type Screenshot

type Screenshot struct {
	Original string `json:"original"`
	Preview  string `json:"preview"`
}

type StatsActiveUsersParams

type StatsActiveUsersParams struct{}

type Studio

type Studio struct {
	ID           int     `json:"id"`
	Name         string  `json:"name"`
	FilteredName string  `json:"filtered_name"`
	Real         bool    `json:"real"`
	Image        *string `json:"image,omitempty"`
}

type StudiosParams

type StudiosParams struct{}

type TooManyRequestsError

type TooManyRequestsError struct{}

func (TooManyRequestsError) Error

func (e TooManyRequestsError) Error() string

type Topic

type Topic struct {
	ID                int          `json:"id"`
	TopicTitle        string       `json:"topic_title"`
	Body              string       `json:"body"`
	HTMLBody          string       `json:"html_body"`
	HTMLFooter        string       `json:"html_footer"`
	CreatedAt         time.Time    `json:"created_at"`
	CommentsCount     int          `json:"comments_count"`
	Forum             Forum        `json:"forum"`
	User              User         `json:"user"`
	Type              string       `json:"type"`
	LinkedID          int          `json:"linked_id"`
	LinkedType        string       `json:"linked_type"`
	Linked            *TopicLinked `json:"linked,omitempty"`
	Viewed            bool         `json:"viewed"`
	LastCommentViewed *bool        `json:"last_comment_viewed,omitempty"`
	Event             *string      `json:"event,omitempty"`
	Episode           *int         `json:"episode,omitempty"`
}

type TopicLinked

type TopicLinked struct {
	Anime
}

Can be Anime, Manga structs.

type TopicsHotParams

type TopicsHotParams struct {
	// 10 maximum.
	Limit int `json:"limit,omitempty"`
}

type TopicsUpdate

type TopicsUpdate struct {
	ID        int         `json:"id"`
	Linked    TopicLinked `json:"linked"`
	Event     *string     `json:"event,omitempty"`
	Episode   *int        `json:"episode,omitempty"`
	CreatedAt time.Time   `json:"created_at"`
	URL       string      `json:"url"`
}

type TopicsUpdatesParams

type TopicsUpdatesParams struct {
	// Must be a number between 1 and 100000.
	Page int `json:"page,omitempty"`

	// 30 maximum.
	Limit int `json:"limit,omitempty"`
}

type UnknownError

type UnknownError struct {
	Status int
	Body   string
}

func (UnknownError) Error

func (e UnknownError) Error() string

type UnprocessableEntityErrors

type UnprocessableEntityErrors []string

func (UnprocessableEntityErrors) Error

type User

type User struct {
	ID           int       `json:"id"`
	Nickname     string    `json:"nickname"`
	Avatar       string    `json:"avatar"`
	Image        UserImage `json:"image"`
	LastOnlineAt time.Time `json:"last_online_at"`
	URL          string    `json:"url"`
}

type UserImage

type UserImage struct {
	X160 string `json:"x160"`
	X148 string `json:"x148"`
	X80  string `json:"x80"`
	X64  string `json:"x64"`
	X48  string `json:"x48"`
	X32  string `json:"x32"`
	X16  string `json:"x16"`
}

type UserRate

type UserRate struct {
	ID         int                 `json:"id"`
	UserID     *int                `json:"user_id,omitempty"`
	TargetID   *int                `json:"target_id,omitempty"`
	TargetType *UserRateTargetType `json:"target_type,omitempty"`
	Score      int                 `json:"score"`
	Status     UserRateStatus      `json:"status"`
	Rewatches  int                 `json:"rewatches"`
	Episodes   *int                `json:"episodes,omitempty"`
	Volumes    *int                `json:"volumes,omitempty"`
	Chapters   *int                `json:"chapters,omitempty"`
	Text       *string             `json:"text,omitempty"`
	TextHTML   string              `json:"text_html"`
	CreatedAt  time.Time           `json:"created_at"`
	UpdatedAt  time.Time           `json:"updated_at"`
}

type UserRateParams

type UserRateParams struct{}

type UserRateStatus

type UserRateStatus string
const (
	UserRatePlanned    UserRateStatus = "planned"
	UserRateWatching   UserRateStatus = "watching"
	UserRateRewatching UserRateStatus = "rewatching"
	UserRateCompleted  UserRateStatus = "completed"
	UserRateOnHold     UserRateStatus = "on_hold"
	UserRateDropped    UserRateStatus = "dropped"
)

type UserRateTargetType

type UserRateTargetType string
const (
	UserRateTargetAnime UserRateTargetType = "Anime"
	UserRateTargetManga UserRateTargetType = "Manga"
)

type UserRatesParams

type UserRatesParams struct {
	UserID int `json:"user_id,omitempty"`

	TargetID int `json:"target_id,omitempty"`

	// Must be one of: Anime, Manga.
	TargetType UserRateTargetType `json:"target_type,omitempty"`

	// Must be one of: planned, watching, rewatching, completed, on_hold, dropped
	Status UserRateStatus `json:"status,omitempty"`

	// Must be a number between 1 and 100000. This field is ignored when user_id is set
	Page int `json:"page,omitempty"`

	// 1000 maximum. This field is ignored when user_id is set
	Limit int `json:"limit,omitempty"`
}

type UsersAnimeRate

type UsersAnimeRate struct {
	ID        int       `json:"id"`
	Score     int       `json:"score"`
	Status    string    `json:"status"`
	Text      *string   `json:"text,omitempty"`
	Episodes  *int      `json:"episodes,omitempty"`
	Chapters  *int      `json:"chapters,omitempty"`
	Volumes   *int      `json:"volumes,omitempty"`
	TextHTML  string    `json:"text_html"`
	Rewatches int       `json:"rewatches"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	User      User      `json:"user"`
	Anime     *Anime    `json:"anime,omitempty"`
	// Can represent Manga and Ranobe structs
	Manga *interface{} `json:"manga,omitempty"`
}

type UsersAnimeRateParams

type UsersAnimeRateParams struct {
	// необязательно
	// Validations:
	//
	// Must be a number between 1 and 100000.
	Page int `json:"page,omitempty"`

	// необязательно
	// 5000 maximum
	//
	// Validations:
	Limit int `json:"limit,omitempty"`

	Status UserRateStatus `json:"status,omitempty"`

	// Set to true to discard hentai, yaoi and yuri
	Censored bool `json:"censored,omitempty"`
}

type Video

type Video struct {
	ID        int     `json:"id"`
	URL       string  `json:"url"`
	ImageURL  string  `json:"image_url"`
	PlayerURL string  `json:"player_url"`
	Name      *string `json:"name,omitempty"`
	Kind      string  `json:"kind"`
	Hosting   string  `json:"hosting"`
}

type VideoParams

type VideoParams struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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