Documentation
¶
Index ¶
- Variables
- type CategoriesContainer
- type Category
- type Client
- func (api *Client) Categories() (*CategoriesContainer, error)
- func (api *Client) Comments(id MovieID, p *CommentsOption) (*CommentsContainer, error)
- func (api *Client) DefaultCommentsOption() *CommentsOption
- func (api *Client) DefaultUserMoviesOption() *UserMoviesOption
- func (api *Client) Movie(id MovieID) (*MovieContainer, error)
- func (api *Client) RecommendedLives() (*Movies, error)
- func (api *Client) SearchLives(p *SearchLivesOptions) (*Movies, error)
- func (api *Client) SearchLivesByTags(tags []string) (*Movies, error)
- func (api *Client) SearchUsers(p *SearchUsersOptions) (*UsersContainer, error)
- func (api *Client) SearchUsersByWords(words []string) (*UsersContainer, error)
- func (api *Client) SetEndpoint(endpoint string)
- func (api *Client) User(id string) (*UserContainer, error)
- func (api *Client) UserMovies(id string, p *UserMoviesOption) (*UserMovies, error)
- type Comment
- type CommentsContainer
- type CommentsOption
- type Movie
- type MovieContainer
- type MovieID
- type Movies
- type SearchLivesOptions
- type SearchUsersOptions
- type SubCategory
- type User
- type UserContainer
- type UserMovies
- type UserMoviesOption
- type UsersContainer
Constants ¶
This section is empty.
Variables ¶
var TwitCastingAPI = "https://apiv2.twitcasting.tv"
TwitCastingAPI is the endpoint of API. It's possible to override it, or use SetEndpoint().
Functions ¶
This section is empty.
Types ¶
type CategoriesContainer ¶
type CategoriesContainer struct {
Categories []Category `json:"categories"`
}
CategoriesContainer holds a list of Categories
type Category ¶
type Category struct {
ID string `json:"id"`
Name string `json:"name"`
SubCategories []SubCategory `json:"sub_categories"`
}
Category such as "声"
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main struct to access all the methods that this package provides.
func (*Client) Categories ¶
func (api *Client) Categories() (*CategoriesContainer, error)
Categories returns a list of Categories and its SubCategories
func (*Client) Comments ¶
func (api *Client) Comments(id MovieID, p *CommentsOption) (*CommentsContainer, error)
Comments retrieves Comments by the given MovieID.
func (*Client) DefaultCommentsOption ¶
func (api *Client) DefaultCommentsOption() *CommentsOption
DefaultCommentsOption returns a CommentsOption with default values.
func (*Client) DefaultUserMoviesOption ¶
func (api *Client) DefaultUserMoviesOption() *UserMoviesOption
DefaultUserMoviesOptions returns a UserMoviesOption with default values.
func (*Client) Movie ¶
func (api *Client) Movie(id MovieID) (*MovieContainer, error)
Movie retrieves a Movie object by the given MovieID.
func (*Client) RecommendedLives ¶
RecommendedLives retrieves recommended Moves on live. See http://apiv2-doc.twitcasting.tv/#search-live-movies
func (*Client) SearchLives ¶
func (api *Client) SearchLives(p *SearchLivesOptions) (*Movies, error)
SearchLives retrieves Movies based on the given parameters.
func (*Client) SearchLivesByTags ¶
SearchLivesByTags retrieves Movies by tag(s).
func (*Client) SearchUsers ¶
func (api *Client) SearchUsers(p *SearchUsersOptions) (*UsersContainer, error)
SearchUsers retrieves Users by the given parameters.
func (*Client) SearchUsersByWords ¶
func (api *Client) SearchUsersByWords(words []string) (*UsersContainer, error)
SearchUsersByWords retrieves Users by the given word(s).
func (*Client) SetEndpoint ¶
SetEndpoint overrides the API host and the root path.
func (*Client) User ¶
func (api *Client) User(id string) (*UserContainer, error)
User retrieves a User object by the given user id
func (*Client) UserMovies ¶
func (api *Client) UserMovies(id string, p *UserMoviesOption) (*UserMovies, error)
UserMovies retrieves Movies by the given user id.
type Comment ¶
type Comment struct {
ID string `json:"id"`
Message string `json:"message"`
From User `json:"from_user"`
Created int `json:"created"`
}
Comment object.
type CommentsContainer ¶
type CommentsContainer struct {
MovieID MovieID `json:"movie_id"`
Count int `json:"all_count"`
Comments []Comment `json:"comments"`
}
CommentsContainer contains a list of Comments and other information.
type CommentsOption ¶
type CommentsOption struct {
Offset int `url:"offset"`
Limit int `url:"limit"`
Since string `url:"since_id"`
}
CommentsOption are the parameters for getting Comments.
type Movie ¶
type Movie struct {
ID MovieID `json:"id"`
UserID string `json:"user_id"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
LastOwnerComment string `json:"last_owner_comment"`
Link string `json:"link"`
Live bool `json:"is_live"`
Recorded bool `json:"is_recorded"`
CommentCount int `json:"comment_count"`
LargeThumbnail string `json:"large_thumbnail"`
SmallThumbnail string `json:"small_thumbnail"`
Country string `json:"country"`
Duration int `json:"duration"`
Created int `json:"created"`
Collabo bool `json:"is_collabo"`
Protected bool `json:"is_protected"`
MaxViewCount int `json:"max_view_count"`
CurrentViewCount int `json:"current_view_count"`
TotalViewCount int `json:"total_view_count"`
HLS string `json:"hls_url"`
}
Movie object. See http://apiv2-doc.twitcasting.tv/#get-movie-info
type MovieContainer ¶
type MovieContainer struct {
Movie Movie `json:"movie"`
Broadcaster User `json:"broadcaster"`
Tags []string `json:"tags"`
}
MovieContainer holds Movie and its related data.
type MovieID ¶
type MovieID string
MovieID is identifier of a Movie object. In the TwitCasting world, it's sequential digits.
func (MovieID) GreaterThan ¶
GreaterThan return true if the source MovieID is greater than the given ID, that means it is newer than the given ID.
type Movies ¶
type Movies struct {
Movies []MovieContainer `json:"movies"`
}
Movies is a slice of MovieContainers.
type SearchLivesOptions ¶
type SearchLivesOptions struct {
Limit int `url:"limit"`
Type string `url:"type"`
Context string `url:"context"`
Lang string `url:"lang"`
}
SearchLivesOptions are the parameters for the Search Live Movies API.
type SearchUsersOptions ¶
type SearchUsersOptions struct {
Words string `url:"words"`
Limit int `url:"limit"`
Lang string `url:"lang"`
}
SearchUsersOptions are the parameters for searching Users.
type SubCategory ¶
type SubCategory struct {
ID string `json:"id"`
Name string `json:"name"`
// Number of current live Movies
Count int `json:"count"`
}
SubCategory such as "イケボ(男子)" in the "声" category
type User ¶
type User struct {
ID string `json:"id"`
ScreenID string `json:"screen_id"`
Name string `json:"name"`
Image string `json:"image"`
Profile string `json:"profile"`
Level int `json:"level"`
LastMovieID MovieID `json:"last_movie_id"`
Live bool `json:"is_live"`
Created int `json:"created"`
}
User object See http://apiv2-doc.twitcasting.tv/#get-user-info
type UserContainer ¶
type UserContainer struct {
User User `json:"user"`
}
UserContainer holds a User object
type UserMovies ¶
type UserMovies struct {
Movies []Movie `json:"movies"`
}
UserMovies is a slice of Movie objects.
type UserMoviesOption ¶
UserMoviesOption is a collection of parameters for getting UserMovies.
type UsersContainer ¶
type UsersContainer struct {
Users []User `json:"users"`
}
UsersContainer holds a list of Users
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
categories
command
|
|
|
comments
command
|
|
|
movies
command
|
|
|
search
command
|
|
|
user_movies
command
|
|
|
users
command
|