annict

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationService

type AuthenticationService service

func (*AuthenticationService) Info

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string

	Authentication *AuthenticationService
	Works          *WorksService
	Episodes       *EpisodesService
	Records        *RecordsService
	Me             struct {
		//Statuses *MeStatusesService
		Records *MeRecordsService
		Works   *MeWorksService
	}
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

type Episode

type Episode struct {
	*EpisodeProps
	Work        Work         `json:"work"`
	PrevEpisode EpisodeProps `json:"prev_episode"`
	NextEpisode EpisodeProps `json:"next_episode"`
}

type EpisodeList

type EpisodeList struct {
	Episodes []Episode `json:"episodes"`
	*Pagination
}

type EpisodeProps

type EpisodeProps struct {
	Id           int64  `json:"id"`
	Number       string `json:"number"`
	NumberText   string `json:"number_text"`
	SortNumber   int64  `json:"sort_number"`
	Title        string `json:"title"`
	RecordsCount int64  `json:"recourds_count"`
}

type EpisodesListOptions

type EpisodesListOptions struct {
	Fields         []string `url:"fields,omitempty"`
	FilterIds      []int64  `url:"filter_ids,omitempty"`
	FilterWorkId   int64    `url:"filter_work_id,omitempty"`
	Page           int64    `url:"page,omitempty"`
	PerPage        int64    `url:"per_page,omitempty"`
	SortId         string   `url:"sort_id,omitempty"`
	SortSortNumber string   `url:"sort_sort_number,omitempty"`
}

type EpisodesService

type EpisodesService service

func (*EpisodesService) List

type MeRecordsListOptions

type MeRecordsListOptions struct {
	EpisodeId     int64   `url:"episode_id"`
	Comment       string  `url:"comment,omitempty"`
	Rating        float32 `url:"rating,omitempty"`
	ShareTwitter  bool    `url:"share_twitter,omitempty"`
	ShareFacebook bool    `url:"share_facebook,omitempty"`
}

type MeRecordsService

type MeRecordsService service

func (*MeRecordsService) Create

type MeStatusesListOptions

type MeStatusesListOptions struct {
	WorkId int64  `url:"work_id"`
	Kind   string `url:"kind"`
}

type MeStatusesService

type MeStatusesService service

func (*MeStatusesService) Change

type MeWorksListOptions

type MeWorksListOptions struct {
	Fields            []string `url:"fields,comma,omitempty"`
	FilterIds         []int64  `url:"filter_ids,comma,omitempty"`
	FilterSeason      string   `url:"filter_season,omitempty"`
	FilterTitle       string   `url:"filter_title,omitempty"`
	FilterStatus      string   `url:"filter_status,omitempty"`
	Page              int64    `url:"page,omitempty"`
	PerPage           int64    `url:"per_page,omitempty"`
	SortId            string   `url:"sort_id,omitempty"`
	SortSeason        string   `url:"sort_season,omitempty"`
	SortWatchersCount string   `url:"sort_watchers_count,omitempty"`
}

type MeWorksService

type MeWorksService service

func (*MeWorksService) List

type Pagination

type Pagination struct {
	TotalCount int64 `json:"total_count"`
	NextPage   int64 `json:"next_page"`
	PrevPage   int64 `json:"prev_page"`
}

type Record

type Record struct {
	Id         int64     `json:"id"`
	Comment    string    `json:"comment"`
	Rating     float32   `json:"rating"`
	IsModified bool      `json:"is_modified"`
	LikesCount int64     `json:"likes_count"`
	CreatedAt  time.Time `json:"created_at"`

	User struct {
		Id           int64     `json:"id"`
		Username     string    `json:"username"`
		Name         string    `json:"name"`
		Description  string    `json:"description"`
		Url          string    `json:"url"`
		RecordsCount int64     `json:"recourds_count"`
		CreatedAt    time.Time `json:"created_at"`
	} `json:"user"`

	Work Work `json:"work"`

	Episode struct {
		Id           int64  `json:"id"`
		Number       string `json:"number"`
		NumberText   string `json:"number_text"`
		SortNumber   int64  `json:"sort_number"`
		Title        string `json:"title"`
		RecordsCount int64  `json:"records_count"`
	} `json:"episode"`
}

type RecordList

type RecordList struct {
	Records []Record `json:"records"`
	*Pagination
}

type RecordsListOptions

type RecordsListOptions struct {
	Fields          []string `url:"fields,comma,omitempty"`
	FilterIds       []int64  `url:"filter_ids,comma,omitempty"`
	FilterEpisodeId int64    `url:"filter_episode_id,omitempty"`
	Page            int64    `url:"page,omitempty"`
	PerPage         int64    `url:"per_page,omitempty"`
	SortId          string   `url:"sort_id,omitempty"`
	SortLikesCount  string   `url:"sort_likes_count,omitempty"`
}

type RecordsService

type RecordsService service

func (*RecordsService) List

type TokenInfo

type TokenInfo struct {
	ResourceOwnerId  int64    `json:"resource_owner_id"`
	Scopes           []string `json:"scopes"`
	ExpiresInSeconds int64    `json:"expires_in_seconds"`
	Application      struct {
		Uid string `json:"uid"`
	} `json:"application"`
	CreatedAt int64 `json:"created_at"`
}

type Work

type Work struct {
	Id             int64  `json:"id"`
	Title          string `json:"title"`
	TitleKana      string `json:"title_kana"`
	Media          string `json:"media"`
	MediaText      string `json:"media_text"`
	SeasonName     string `json:"season_name"`
	SeasonNameText string `json:"season_name_text"`

	// TODO: time.TimeのunmarshalがデフォルトでRFC3339なのでparseできない
	// 自前で実装する必要がある
	ReleasedOn      string `json:"released_on"`
	ReleasedOnAbout string `json:"released_on_about"`

	OfficialSiteUrl string `json:"official_site_url"`
	WikipediaUrl    string `json:"wikipedia_url"`
	TwitterUsername string `json:"twitter_username"`
	TwitterHashtag  string `json:"twitter_hashtag"`
	EpisodesCount   int    `json:"episodes_count"`
	WatchersCount   int64  `json:"watchers_count"`
}

type WorkList

type WorkList struct {
	Works []Work `json:"works"`
	*Pagination
}

type WorksListOptions

type WorksListOptions struct {
	Fields            []string `url:"fields,comma,omitempty"`
	FilterIds         []int64  `url:"filter_ids,comma,omitempty"`
	FilterSeason      string   `url:"filter_season,omitempty"`
	FilterTitle       string   `url:"filter_title,omitempty"`
	Page              int64    `url:"page,omitempty"`
	PerPage           int64    `url:"per_page,omitempty"`
	SortId            string   `url:"sort_id,omitempty"`
	SortSeason        string   `url:"sort_season,omitempty"`
	SortWatchersCount string   `url:"sort_watchers_count,omitempty"`
}

type WorksService

type WorksService service

func (*WorksService) List

Jump to

Keyboard shortcuts

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