kitsu

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 4 Imported by: 12

README

kitsu

Godoc Report Tests Coverage Sponsor

Kitsu 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

View Source
const (
	AnimeListStatusWatching  = "current"
	AnimeListStatusCompleted = "completed"
	AnimeListStatusPlanned   = "planned"
	AnimeListStatusHold      = "on_hold"
	AnimeListStatusDropped   = "dropped"
)

AnimeListStatus values for anime list items

View Source
const (
	// APIBaseURL is the prefix for all API requests.
	APIBaseURL = "https://kitsu.io/api/edge/"
)

Variables

This section is empty.

Functions

func FixImageURL

func FixImageURL(url string) string

FixImageURL removes the right-most part, e.g. "?1416336000" from image URLs. Additionally it also remove the protocol ("https:")

func Get

func Get(query string) (*client.Response, error)

Get performs a GET request to the Kitsu API.

func StreamAnime

func StreamAnime() chan *Anime

StreamAnime returns a stream of all anime objects (async).

func StreamCharacters

func StreamCharacters() chan *Character

StreamCharacters returns a stream of all character objects (async).

func StreamMappings

func StreamMappings() chan *Mapping

StreamMappings returns a stream of all mappings (async).

func StreamMediaRelations

func StreamMediaRelations() chan *MediaRelation

StreamMediaRelations returns a stream of all anime relations (async).

Types

type APILinks struct {
	First string `json:"first"`
	Prev  string `json:"prev"`
	Next  string `json:"next"`
	Last  string `json:"last"`
}

APILinks ...

type Anime

type Anime struct {
	ID string `json:"id"`
	// Type  string `json:"type"`
	// Links struct {
	// 	Self string `json:"self"`
	// } `json:"links"`
	Attributes struct {
		Slug                string `json:"slug"`
		Synopsis            string `json:"synopsis"`
		CoverImageTopOffset int    `json:"coverImageTopOffset"`
		Titles              struct {
			En   string `json:"en"`
			EnJp string `json:"en_jp"`
			JaJp string `json:"ja_jp"`
		} `json:"titles"`
		CanonicalTitle    string   `json:"canonicalTitle"`
		AbbreviatedTitles []string `json:"abbreviatedTitles"`
		AverageRating     string   `json:"averageRating"`
		// RatingFrequencies struct {
		// 	Num2  string `json:"2"`
		// 	Num3  string `json:"3"`
		// 	Num4  string `json:"4"`
		// 	Num5  string `json:"5"`
		// 	Num6  string `json:"6"`
		// 	Num7  string `json:"7"`
		// 	Num8  string `json:"8"`
		// 	Num9  string `json:"9"`
		// 	Num10 string `json:"10"`
		// 	Num11 string `json:"11"`
		// 	Num12 string `json:"12"`
		// 	Num13 string `json:"13"`
		// 	Num14 string `json:"14"`
		// 	Num15 string `json:"15"`
		// 	Num16 string `json:"16"`
		// 	Num17 string `json:"17"`
		// 	Num18 string `json:"18"`
		// 	Num19 string `json:"19"`
		// 	Num20 string `json:"20"`
		// } `json:"ratingFrequencies"`
		// UserCount      int    `json:"userCount"`
		// FavoritesCount int    `json:"favoritesCount"`
		StartDate string `json:"startDate"`
		EndDate   string `json:"endDate"`
		// PopularityRank int    `json:"popularityRank"`
		// RatingRank     int    `json:"ratingRank"`
		AgeRating      string `json:"ageRating"`
		AgeRatingGuide string `json:"ageRatingGuide"`
		Subtype        string `json:"subtype"`
		Status         string `json:"status"`
		PosterImage    struct {
			Tiny     string `json:"tiny"`
			Small    string `json:"small"`
			Medium   string `json:"medium"`
			Large    string `json:"large"`
			Original string `json:"original"`
		} `json:"posterImage"`
		CoverImage struct {
			Tiny     string `json:"tiny"`
			Small    string `json:"small"`
			Large    string `json:"large"`
			Original string `json:"original"`
		} `json:"coverImage"`
		EpisodeCount   int    `json:"episodeCount"`
		EpisodeLength  int    `json:"episodeLength"`
		YoutubeVideoID string `json:"youtubeVideoId"`
		ShowType       string `json:"showType"`
		Nsfw           bool   `json:"nsfw"`
	} `json:"attributes"`
}

Anime in the Kitsu API. Example: https://kitsu.io/api/edge/anime/1

func GetAnime

func GetAnime(id string) (*Anime, error)

GetAnime returns the anime for the given ID.

func (anime *Anime) Link() string

Link returns the full URL to the anime.

type AnimeCharactersResponse

type AnimeCharactersResponse struct {
	Data struct {
		ID    string `json:"id"`
		Type  string `json:"type"`
		Links struct {
			Self string `json:"self"`
		} `json:"links"`
		Attributes struct {
			CreatedAt           time.Time `json:"createdAt"`
			UpdatedAt           time.Time `json:"updatedAt"`
			Slug                string    `json:"slug"`
			Synopsis            string    `json:"synopsis"`
			CoverImageTopOffset int       `json:"coverImageTopOffset"`
			Titles              struct {
				En   string `json:"en"`
				EnJp string `json:"en_jp"`
				JaJp string `json:"ja_jp"`
			} `json:"titles"`
			CanonicalTitle    string      `json:"canonicalTitle"`
			AbbreviatedTitles interface{} `json:"abbreviatedTitles"`
			AverageRating     string      `json:"averageRating"`
			RatingFrequencies struct {
				Num2  string `json:"2"`
				Num3  string `json:"3"`
				Num4  string `json:"4"`
				Num5  string `json:"5"`
				Num6  string `json:"6"`
				Num7  string `json:"7"`
				Num8  string `json:"8"`
				Num9  string `json:"9"`
				Num10 string `json:"10"`
				Num11 string `json:"11"`
				Num12 string `json:"12"`
				Num13 string `json:"13"`
				Num14 string `json:"14"`
				Num15 string `json:"15"`
				Num16 string `json:"16"`
				Num17 string `json:"17"`
				Num18 string `json:"18"`
				Num19 string `json:"19"`
				Num20 string `json:"20"`
			} `json:"ratingFrequencies"`
			UserCount      int    `json:"userCount"`
			FavoritesCount int    `json:"favoritesCount"`
			StartDate      string `json:"startDate"`
			EndDate        string `json:"endDate"`
			PopularityRank int    `json:"popularityRank"`
			RatingRank     int    `json:"ratingRank"`
			AgeRating      string `json:"ageRating"`
			AgeRatingGuide string `json:"ageRatingGuide"`
			Subtype        string `json:"subtype"`
			Status         string `json:"status"`
			PosterImage    struct {
				Tiny     string `json:"tiny"`
				Small    string `json:"small"`
				Medium   string `json:"medium"`
				Large    string `json:"large"`
				Original string `json:"original"`
			} `json:"posterImage"`
			CoverImage struct {
				Tiny     string `json:"tiny"`
				Small    string `json:"small"`
				Large    string `json:"large"`
				Original string `json:"original"`
			} `json:"coverImage"`
			EpisodeCount   int    `json:"episodeCount"`
			EpisodeLength  int    `json:"episodeLength"`
			YoutubeVideoID string `json:"youtubeVideoId"`
			ShowType       string `json:"showType"`
			Nsfw           bool   `json:"nsfw"`
		} `json:"attributes"`
		Relationships struct {
			Genres struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"genres"`
			Categories struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"categories"`
			Castings struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"castings"`
			Installments struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"installments"`
			Mappings struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"mappings"`
			Reviews struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"reviews"`
			MediaRelationships struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"mediaRelationships"`
			Episodes struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"episodes"`
			StreamingLinks struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"streamingLinks"`
			AnimeProductions struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"animeProductions"`
			AnimeCharacters struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
				Data []struct {
					Type string `json:"type"`
					ID   string `json:"id"`
				} `json:"data"`
			} `json:"animeCharacters"`
			AnimeStaff struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"animeStaff"`
		} `json:"relationships"`
	} `json:"data"`
	Included []struct {
		ID    string `json:"id"`
		Type  string `json:"type"`
		Links struct {
			Self string `json:"self"`
		} `json:"links"`
		Attributes    map[string]interface{} `json:"attributes"`
		Relationships struct {
			Anime struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"anime"`
			Character struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
				Data struct {
					ID   string `json:"id"`
					Type string `json:"type"`
				} `json:"data"`
			} `json:"character"`
			Castings struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"castings"`
		} `json:"relationships"`
	} `json:"included"`
}

AnimeCharactersResponse ...

func GetAnimeCharactersForAnime

func GetAnimeCharactersForAnime(animeID string) (*AnimeCharactersResponse, error)

GetAnimeCharactersForAnime ...

type AnimePage

type AnimePage struct {
	Data     []*Anime   `json:"data"`
	Included []*Mapping `json:"included"`
	Meta     struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links APILinks `json:"links"`
}

AnimePage represents one page containing up to 20 anime objects.

func GetAnimePage

func GetAnimePage(query string) (*AnimePage, error)

GetAnimePage expects the usual query parameter and returns an AnimePage object.

type AnimeResponse

type AnimeResponse struct {
	Data *Anime `json:"data"`
}

AnimeResponse represents the response for an anime request.

type Character

type Character struct {
	ID   string `json:"id"`
	Type string `json:"type"`
	// Links struct {
	// 	Self string `json:"self"`
	// } `json:"links"`
	Attributes struct {
		Slug  string `json:"slug"`
		Names struct {
			En   string `json:"en"`
			JaJp string `json:"ja_jp"`
		} `json:"names"`
		CanonicalName string   `json:"canonicalName"`
		OtherNames    []string `json:"otherNames"`
		MalID         int      `json:"malId"`
		Description   string   `json:"description"`
		Image         struct {
			Original string `json:"original"`
		} `json:"image"`
	} `json:"attributes"`
}

Character is a character in the Kitsu API. Example: https://kitsu.io/api/edge/characters/1

type CharacterPage

type CharacterPage struct {
	Data []*Character `json:"data"`
	Meta struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links struct {
		First string `json:"first"`
		Next  string `json:"next"`
		Last  string `json:"last"`
	} `json:"links"`
}

CharacterPage represents one page containing up to 10 character objects.

func GetCharacterPage

func GetCharacterPage(query string) (*CharacterPage, error)

GetCharacterPage expects the usual query parameter and returns an CharacterPage object instead of a raw string.

type LibraryEntry

type LibraryEntry struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Links struct {
		Self string `json:"self"`
	} `json:"links"`
	Attributes struct {
		CreatedAt      time.Time   `json:"createdAt"`
		UpdatedAt      time.Time   `json:"updatedAt"`
		Status         string      `json:"status"`
		Progress       int         `json:"progress"`
		VolumesOwned   int         `json:"volumesOwned"`
		Reconsuming    bool        `json:"reconsuming"`
		ReconsumeCount int         `json:"reconsumeCount"`
		Notes          string      `json:"notes"`
		Private        bool        `json:"private"`
		ProgressedAt   interface{} `json:"progressedAt"`
		StartedAt      interface{} `json:"startedAt"`
		FinishedAt     interface{} `json:"finishedAt"`
		Rating         string      `json:"rating"`
		RatingTwenty   int         `json:"ratingTwenty"`
	} `json:"attributes"`
	Relationships struct {
		User struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"user"`
		Anime struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
			Data *Relationship `json:"data"`
		} `json:"anime"`
		Manga struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"manga"`
		Drama struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"drama"`
		Review struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"review"`
		MediaReaction struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"mediaReaction"`
		Media struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"media"`
		Unit struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"unit"`
		NextUnit struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"nextUnit"`
	} `json:"relationships"`

	// Custom fields, added by this client.
	// Doesn't really exist in the API
	Anime *Anime
}

LibraryEntry ...

type LibraryEntryPage

type LibraryEntryPage struct {
	Data     []*LibraryEntry `json:"data"`
	Included []*Anime        `json:"included"`
	Meta     struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links struct {
		First string `json:"first"`
		Next  string `json:"next"`
		Last  string `json:"last"`
	} `json:"links"`
}

LibraryEntryPage ...

func GetLibraryEntryPage

func GetLibraryEntryPage(query string) (*LibraryEntryPage, error)

GetLibraryEntryPage ...

type Mapping

type Mapping struct {
	ID string `json:"id"`
	// Type string `json:"type"`
	// Links struct {
	// 	Self string `json:"self"`
	// } `json:"links"`
	Attributes struct {
		// CreatedAt    interface{} `json:"createdAt"`
		// UpdatedAt    interface{} `json:"updatedAt"`
		ExternalSite string `json:"externalSite"`
		ExternalID   string `json:"externalId"`
	} `json:"attributes"`
	Relationships struct {
		Item struct {
			// Links struct {
			// 	Self    string `json:"self"`
			// 	Related string `json:"related"`
			// } `json:"links"`
			Data struct {
				Type string `json:"type"`
				ID   string `json:"id"`
			} `json:"data"`
		} `json:"item"`
	} `json:"relationships"`
}

Mapping ...

type MappingsPage

type MappingsPage struct {
	Data  []*Mapping `json:"data"`
	Links APILinks   `json:"links"`
}

MappingsPage ... Example: https://kitsu.io/api/edge/mappings/?include=item

func GetMappingsPage

func GetMappingsPage(query string) (*MappingsPage, error)

GetMappingsPage expects the usual query parameter and returns an MappingPage object.

type MediaRelation

type MediaRelation struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Links struct {
		Self string `json:"self"`
	} `json:"links"`
	Attributes struct {
		CreatedAt interface{} `json:"createdAt"`
		UpdatedAt interface{} `json:"updatedAt"`
		Role      string      `json:"role"`
	} `json:"attributes"`
	Relationships struct {
		Source struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
			Data struct {
				Type string `json:"type"`
				ID   string `json:"id"`
			} `json:"data"`
		} `json:"source"`
		Destination struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
			Data struct {
				Type string `json:"type"`
				ID   string `json:"id"`
			} `json:"data"`
		} `json:"destination"`
	} `json:"relationships"`
}

MediaRelation ...

type MediaRelationsResponse

type MediaRelationsResponse struct {
	Data     []*MediaRelation `json:"data"`
	Included []struct {
		ID    string `json:"id"`
		Type  string `json:"type"`
		Links struct {
			Self string `json:"self"`
		} `json:"links"`
		Attributes struct {
			CreatedAt           time.Time `json:"createdAt"`
			UpdatedAt           time.Time `json:"updatedAt"`
			Slug                string    `json:"slug"`
			Synopsis            string    `json:"synopsis"`
			CoverImageTopOffset int       `json:"coverImageTopOffset"`
			Titles              struct {
				EnJp string `json:"en_jp"`
				JaJp string `json:"ja_jp"`
			} `json:"titles"`
			CanonicalTitle    string        `json:"canonicalTitle"`
			AbbreviatedTitles []interface{} `json:"abbreviatedTitles"`
			AverageRating     string        `json:"averageRating"`
			RatingFrequencies struct {
				Num2  string `json:"2"`
				Num3  string `json:"3"`
				Num4  string `json:"4"`
				Num5  string `json:"5"`
				Num6  string `json:"6"`
				Num7  string `json:"7"`
				Num8  string `json:"8"`
				Num9  string `json:"9"`
				Num10 string `json:"10"`
				Num11 string `json:"11"`
				Num12 string `json:"12"`
				Num13 string `json:"13"`
				Num14 string `json:"14"`
				Num15 string `json:"15"`
				Num16 string `json:"16"`
				Num17 string `json:"17"`
				Num18 string `json:"18"`
				Num19 string `json:"19"`
				Num20 string `json:"20"`
			} `json:"ratingFrequencies"`
			UserCount      int         `json:"userCount"`
			FavoritesCount int         `json:"favoritesCount"`
			StartDate      string      `json:"startDate"`
			EndDate        string      `json:"endDate"`
			PopularityRank int         `json:"popularityRank"`
			RatingRank     int         `json:"ratingRank"`
			AgeRating      string      `json:"ageRating"`
			AgeRatingGuide string      `json:"ageRatingGuide"`
			Subtype        string      `json:"subtype"`
			Status         string      `json:"status"`
			Tba            interface{} `json:"tba"`
			PosterImage    struct {
				Tiny     string `json:"tiny"`
				Small    string `json:"small"`
				Medium   string `json:"medium"`
				Large    string `json:"large"`
				Original string `json:"original"`
				Meta     struct {
					Dimensions struct {
						Tiny struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"tiny"`
						Small struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"small"`
						Medium struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"medium"`
						Large struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"large"`
					} `json:"dimensions"`
				} `json:"meta"`
			} `json:"posterImage"`
			CoverImage struct {
				Tiny     string `json:"tiny"`
				Small    string `json:"small"`
				Large    string `json:"large"`
				Original string `json:"original"`
				Meta     struct {
					Dimensions struct {
						Tiny struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"tiny"`
						Small struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"small"`
						Large struct {
							Width  interface{} `json:"width"`
							Height interface{} `json:"height"`
						} `json:"large"`
					} `json:"dimensions"`
				} `json:"meta"`
			} `json:"coverImage"`
			EpisodeCount   int         `json:"episodeCount"`
			EpisodeLength  int         `json:"episodeLength"`
			YoutubeVideoID interface{} `json:"youtubeVideoId"`
			ShowType       string      `json:"showType"`
			Nsfw           bool        `json:"nsfw"`
		} `json:"attributes"`
		Relationships struct {
			Genres struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"genres"`
			Categories struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"categories"`
			Castings struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"castings"`
			Installments struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"installments"`
			Mappings struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"mappings"`
			Reviews struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"reviews"`
			MediaRelationships struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"mediaRelationships"`
			Episodes struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"episodes"`
			StreamingLinks struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"streamingLinks"`
			AnimeProductions struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"animeProductions"`
			AnimeCharacters struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"animeCharacters"`
			AnimeStaff struct {
				Links struct {
					Self    string `json:"self"`
					Related string `json:"related"`
				} `json:"links"`
			} `json:"animeStaff"`
		} `json:"relationships"`
	} `json:"included"`
	Meta struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links struct {
		First string `json:"first"`
		Next  string `json:"next"`
		Last  string `json:"last"`
	} `json:"links"`
}

MediaRelationsResponse ...

func GetMediaRelations

func GetMediaRelations(query string) (*MediaRelationsResponse, error)

GetMediaRelations expects the usual query parameter and returns an MediaRelationsResponse object.

type Relationship

type Relationship struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

Relationship ...

type User

type User struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Links struct {
		Self string `json:"self"`
	} `json:"links"`
	Attributes struct {
		CreatedAt          time.Time   `json:"createdAt"`
		UpdatedAt          time.Time   `json:"updatedAt"`
		Name               string      `json:"name"`
		PastNames          []string    `json:"pastNames"`
		About              string      `json:"about"`
		Bio                string      `json:"bio"`
		AboutFormatted     interface{} `json:"aboutFormatted"`
		Location           string      `json:"location"`
		WaifuOrHusbando    interface{} `json:"waifuOrHusbando"`
		FollowersCount     int         `json:"followersCount"`
		FacebookID         string      `json:"facebookId"`
		FollowingCount     int         `json:"followingCount"`
		LifeSpentOnAnime   int         `json:"lifeSpentOnAnime"`
		Birthday           interface{} `json:"birthday"`
		Gender             string      `json:"gender"`
		CommentsCount      int         `json:"commentsCount"`
		FavoritesCount     int         `json:"favoritesCount"`
		LikesGivenCount    int         `json:"likesGivenCount"`
		ReviewsCount       int         `json:"reviewsCount"`
		LikesReceivedCount int         `json:"likesReceivedCount"`
		PostsCount         int         `json:"postsCount"`
		RatingsCount       int         `json:"ratingsCount"`
		ProExpiresAt       interface{} `json:"proExpiresAt"`
		Title              string      `json:"title"`
		ProfileCompleted   bool        `json:"profileCompleted"`
		FeedCompleted      bool        `json:"feedCompleted"`
		Website            string      `json:"website"`
		Avatar             struct {
			Tiny     string `json:"tiny"`
			Small    string `json:"small"`
			Medium   string `json:"medium"`
			Large    string `json:"large"`
			Original string `json:"original"`
		} `json:"avatar"`
		CoverImage struct {
			Tiny     string `json:"tiny"`
			Small    string `json:"small"`
			Large    string `json:"large"`
			Original string `json:"original"`
		} `json:"coverImage"`
		RatingSystem string `json:"ratingSystem"`
		Theme        string `json:"theme"`
	} `json:"attributes"`
	Relationships struct {
		Waifu struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"waifu"`
		PinnedPost struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"pinnedPost"`
		Followers struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"followers"`
		Following struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"following"`
		Blocks struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"blocks"`
		LinkedAccounts struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"linkedAccounts"`
		ProfileLinks struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"profileLinks"`
		MediaFollows struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"mediaFollows"`
		UserRoles struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"userRoles"`
		LibraryEntries struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"libraryEntries"`
		Favorites struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"favorites"`
		Reviews struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"reviews"`
		Stats struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"stats"`
		NotificationSettings struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"notificationSettings"`
		OneSignalPlayers struct {
			Links struct {
				Self    string `json:"self"`
				Related string `json:"related"`
			} `json:"links"`
		} `json:"oneSignalPlayers"`
	} `json:"relationships"`
}

User ...

func GetUser

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

GetUser returns the user with the given nickname.

func (*User) StreamLibraryEntries

func (user *User) StreamLibraryEntries() chan *LibraryEntry

StreamLibraryEntries returns a stream of all library entries (async).

type UserResponse

type UserResponse struct {
	Data []*User `json:"data"`
	Meta struct {
		Count int `json:"count"`
	} `json:"meta"`
	Links struct {
		First string `json:"first"`
		Last  string `json:"last"`
	} `json:"links"`
}

UserResponse ...

Jump to

Keyboard shortcuts

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