models

package
v0.0.0-...-f3dad25 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 1 Imported by: 0

README

Структуры Шикимори

Терминология

  • video.go (Video, Videos) -- трейлеры, опенинги, эндинги и пр.
  • animevideo.go (AnimeVideo) -- эпизод/фильм самого аниме

Documentation

Index

Constants

View Source
const (
	// kinds of anime
	AnimeKindTV      = "tv"
	AnimeKindMovie   = "movie"
	AnimeKindOVA     = "ova"
	AnimeKindONA     = "ona"
	AnimeKindSpecial = "special"
	AnimeKindMusic   = "music"
	AnimeKindTV13    = "tv_13"
	AnimeKindTV24    = "tv_24"
	AnimeKindTV48    = "tv_48"

	// status of anime
	AnimeStatusAnons    = "anons"
	AnimeStatusOngoing  = "ongoing"
	AnimeStatusReleased = "released"

	// durations of episode
	AnimeDurationLess10Min = "S"
	AnimeDurationLess30Min = "D"
	AnimeDurationMore30Min = "F"

	// age rating of episode
	AnimeRatingNone  = "none"   // none – No rating
	AnimeRatingG     = "g"      // G - All ages
	AnimeRatingPG    = "pg"     // PG - Children
	AnimeRatingPG13  = "pg_13"  // PG-13 - Teens 13 or older
	AnimeRatingR     = "r"      // R - 17+ recommended (violence & profanity)
	AnimeRatingRPlus = "r_plus" // R+ - Mild Nudity (may also contain violence & profanity)
	AnimeRatingRx    = "rx"     // Rx - Hentai (extreme sexual content/nudity)

	// user list statuses
	AnimeListPlanned    = "planned"
	AnimeListWatching   = "watching"
	AnimeListRewatching = "rewatching"
	AnimeListCompleted  = "completed"
	AnimeListOnHold     = "on_hold"
	AnimeListDropped    = "dropped"

	// sort order
	AnimeOrderByID         = "id"
	AnimeOrderByRanked     = "ranked"
	AnimeOrderByKind       = "kind"
	AnimeOrderByPopularity = "popularity"
	AnimeOrderByName       = "name"
	AnimeOrderByAiredOn    = "aired_on"
	AnimeOrderByEpisodes   = "episodes"
	AnimeOrderByStatus     = "status"
	AnimeOrderByRandom     = "random"
)
View Source
const (
	// kind of anime video
	AnimeVideoKindRaw       = "raw"
	AnimeVideoKindSubtitles = "subtitles"
	AnimeVideoKindFandub    = "fandub"
	AnimeVideoKindUnknown   = "unknown"

	// languages of anime video
	AnimeVideoLanguageRussian  = "russian"
	AnimeVideoLanguageEnglish  = "english"
	AnimeVideoLanguageOriginal = "original"
	AnimeVideoLanguageUnknown  = "unknown"

	// quality of video
	AnimeVideoQualityBD      = "bd"
	AnimeVideoQualityWeb     = "web"
	AnimeVideoQualityTV      = "tv"
	AnimeVideoQualityDVD     = "dvd"
	AnimeVideoQualityUnknown = "unknown"
)
View Source
const (
	// MessageKindPrivate is one of InnerMessage.Kind
	MessageKindPrivate = "Private"

	// Message types
	MessageTypeNews          = "news"
	MessageTypeNotifications = "notifications"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Achievement

type Achievement struct {
	ID     int32  `json:"id"`
	NekoID string `json:"neko_id"`
	Level  int32  `json:"level"`

	// Progress has int8 because it changes 0..100 (?)
	Progress int8  `json:"progress"`
	UserID   int32 `json:"user_id"`

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Achievement of Shikimori

type Achievements

type Achievements []Achievement

Achievements of some user

type Anime

type Anime struct {
	ID          int32  `json:"id"`
	Name        string `json:"name"`
	RussianName string `json:"russian"`

	Image  AnimeImage `json:"image"`
	URL    string     `json:"url"`
	Kind   string     `json:"kind"`
	Status string     `json:"status"`

	Episodes      int16 `json:"episodes"`
	EpisodesAired int16 `json:"episodes_aired"`

	// todo: посмотреть, можно ли их как-нибудь легко/удобно перевести в time.Time
	AiredOn    string `json:"aired_on"`
	ReleasedOn string `json:"released_on"`
}

Anime is short description of some anime. Ex., GET /api/anime

type AnimeDetailed

type AnimeDetailed struct {
	Anime
	Rating string `json:"rating"`

	English  []string `json:"english"`
	Japanese []string `json:"japanese"`
	Synonyms []string `json:"synonyms"`

	// Duration of an episode
	Duration int16  `json:"duration"`
	Score    string `json:"score"`

	Description       string `json:"description"`
	HTMLDescription   string `json:"description_html"`
	SourceDescription string `json:"description_source"`

	Franchise string `json:"franchise"`
	Favoured  bool   `json:"favoured"`
	Anons     bool   `json:"anons"`
	Ongoing   bool   `json:"ongoing"`

	ThreadID      int32 `json:"thread_id"`
	TopicID       int32 `json:"topic_id"`
	MyListAnimeID int32 `json:"myanimelist_id"`

	RatesScoresStats   []ScoreStat `json:"rates_scores_stats"`
	RatesStatusesStats []UseStat   `json:"rates_statuses_stats"`

	UpdatedAt     time.Time `json:"updated_at"`
	NextEpisodeAt time.Time `json:"next_episode_at"`

	Genres  Genres  `json:"genres"`
	Studios Studios `json:"studios"`

	// Last videos of anime (not all: get it all separately)
	LastVideos      Videos      `json:"videos"`
	LastScreenshots Screenshots `json:"screenshots"`

	UserRate AnimeRate `json:"user_rate"`
}

AnimeDetailed is full description of some anime. Ex., GET /api/animes/:id

type AnimeImage

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

type AnimeRate

type AnimeRate struct {
	ID     int32  `json:"id"`
	Score  int8   `json:"score"`
	Status string `json:"status"`

	Text     string `json:"text"`
	HTMLText string `json:"text_html"`

	Episodes  int16 `json:"episodes"`
	Rewatches int8  `json:"rewatches"`
}

type AnimeRates

type AnimeRates []AnimeRate

type AnimeVideo

type AnimeVideo struct {
	AnimeID  int32  `json:"anime_id"`
	Episode  int16  `json:"episode"`
	Kind     string `json:"kind"`
	Language string `json:"language"`
	Quality  string `json:"quality"`
	Source   string `json:"source"`
	URL      string `json:"url"`

	// Формат записи: Название_проекта/студии (Ник_даббера1 & Ник_даббера2).
	// Поле необязательное.
	AuthorName string `json:"author_name,omitempty"`
}

type Animes

type Animes []Anime

type DeleteAllMessages

type DeleteAllMessages struct {
	Frontend     bool   `json:"frontend"`
	MessagesType string `json:"type"`
}

DeleteAllMessages - Delete all messages https://shikimori.org/api/doc/1.0/messages/delete_all

type Genre

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

type Genres

type Genres []Genre

type InnerMessage

type InnerMessage struct {
	Body string `json:"body"`
	Kind string `json:"kind"`

	FromID string `json:"from_id"`
	ToID   string `json:"to_id"`
}

InnerMessage of Message struct

type MarkReadMessages

type MarkReadMessages struct {
	// IDs list separated by comma.
	// Ex., "17,18,987654".
	IDs string `json:"ids"`

	// Ex., "1"
	IsRead string `json:"is_read"`
}

MarkReadMessages - Mark messages as read or unread. https://shikimori.org/api/doc/1.0/messages/read_all

type Message

type Message struct {
	Frontend bool         `json:"frontend"`
	Inner    InnerMessage `json:"message"`
}

Message of Shikimori

type MessageResult

type MessageResult struct {
	ID   int32  `json:"id"`
	Kind string `json:"kind"`
	Read bool   `json:"read"`

	Body     string `json:"body"`
	HTMLBody string `json:"html_body"`

	CreatedAt time.Time `json:"created_at"`

	// todo: посмотреть, что это.
	Linked interface{}

	From User `json:"from"`
	To   User `json:"to"`
}

MessageResult of POST-request Message struct

type ReadAllMessages

type ReadAllMessages struct {
	Frontend     bool   `json:"frontend"`
	MessagesType string `json:"type"`
}

ReadAllMessages - Mark all messages as read https://shikimori.org/api/doc/1.0/messages/read_all

type ScoreStat

type ScoreStat struct {
	Name  int8  `json:"name"`
	Value int32 `json:"value"`
}

type Screenshot

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

type Screenshots

type Screenshots []Screenshot

type Studio

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

Studio on Shikimori

type Studios

type Studios []Studio

Studios on Shikimori

type UseStat

type UseStat struct {
	Name  string `json:"name"`
	Value int32  `json:"value"`
}

type User

type User struct {
	ID       int32  `json:"id"`
	Nickname string `json:"nickname"`

	Avatar string    `json:"avatar"`
	Image  UserImage `json:"image"`

	LastOnlineAt time.Time `json:"last_online_at"`
}

User of Shikimori. Ex., GET /api/users

type UserBrief

type UserBrief struct {
	User

	Name      string `json:"name"`
	Sex       string `json:"sex"`
	Website   string `json:"website"`
	BirthDate string `json:"birth_on"`
	Locale    string `json:"locale"`
}

UserBrief of Shikimori. Ex., GET /api/users/:id/info

type UserDetailed

type UserDetailed struct {
	// todo
	UserBrief
}

UserDetailed of Shikimori. Ex., GET /api/users/:id

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"`
}

UserImage of Shikimori user

type Users

type Users []User

type Video

type Video struct {
	ID        int32  `json:"id"`
	URL       string `json:"url"`
	Image     string `json:"image_url"`
	PlayerURL string `json:"player_url"`
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	Hosting   string `json:"hosting"`
}

type Videos

type Videos []Video

Jump to

Keyboard shortcuts

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