Documentation
¶
Index ¶
- Variables
- func AllPages(fetch func(page int) ([]map[string]any, error), maxPages int) ([]map[string]any, error)
- type UserEndpoint
- func (e *UserEndpoint) Collected(kind string) ([]map[string]any, error)
- func (e *UserEndpoint) CollectedPage(kind string, page int) ([]map[string]any, error)
- func (e *UserEndpoint) Mark(movieID, status string, score int, content string) (map[string]any, error)
- func (e *UserEndpoint) RecentViewed() ([]map[string]any, error)
- func (e *UserEndpoint) ReviewMoviesPage(status string, page int) ([]map[string]any, error)
- func (e *UserEndpoint) Unmark(movieID string) (bool, error)
- func (e *UserEndpoint) WantMovies() ([]map[string]any, error)
- func (e *UserEndpoint) WatchedMovies() ([]map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
var CollectionSpecs = map[string]struct { Path string Key string }{ "actors": {"/api/v1/users/collected_actors", "actors"}, "series": {"/api/v1/users/collected_series", "series"}, "codes": {"/api/v1/users/collected_codes", "codes"}, "makers": {"/api/v1/users/collected_makers", "makers"}, "directors": {"/api/v1/users/collected_directors", "directors"}, }
CollectionSpecs maps collection kind → (path, response list key). collected_lists is intentionally omitted (server 500).
Functions ¶
Types ¶
type UserEndpoint ¶
type UserEndpoint struct {
// contains filtered or unexported fields
}
UserEndpoint 提供用户 review、标记与收藏 capability。
func NewUser ¶
func NewUser(c *client.Client, movie *movie.MovieEndpoint) *UserEndpoint
NewUser 用共享 transport 与 movie capability 构造 user capability。
func (*UserEndpoint) Collected ¶
func (e *UserEndpoint) Collected(kind string) ([]map[string]any, error)
Collected aggregates all pages of a collection kind.
func (*UserEndpoint) CollectedPage ¶
CollectedPage is one page of a user collection kind.
func (*UserEndpoint) Mark ¶
func (e *UserEndpoint) Mark(movieID, status string, score int, content string) (map[string]any, error)
Mark posts POST /api/v1/movies/{id}/reviews. status ∈ watched|want_watch.
func (*UserEndpoint) RecentViewed ¶
func (e *UserEndpoint) RecentViewed() ([]map[string]any, error)
RecentViewed returns GET /api/v1/users/recent_viewed movies (unpaged).
func (*UserEndpoint) ReviewMoviesPage ¶
ReviewMoviesPage is one page of GET /api/v2/users/review_movies.
func (*UserEndpoint) Unmark ¶
func (e *UserEndpoint) Unmark(movieID string) (bool, error)
Unmark deletes the user's review for a movie. Returns false if none.
func (*UserEndpoint) WantMovies ¶
func (e *UserEndpoint) WantMovies() ([]map[string]any, error)
WantMovies returns all want_watch (想看) movies.
func (*UserEndpoint) WatchedMovies ¶
func (e *UserEndpoint) WatchedMovies() ([]map[string]any, error)
WatchedMovies returns all watched (看過) movies.