api

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Token Token
	// contains filtered or unexported fields
}

API : APIクライアント

func New

func New(t *Token) *API

New : 新しいクライアントを作成

func (*API) CreateAuthorizeURL

func (c *API) CreateAuthorizeURL() (string, error)

CreateAuthorizeURL : 認証用URLを作成

func (*API) CreateEpisodeRecords

func (a *API) CreateEpisodeRecords(episodeIDs []string, rating gen.RatingState, comment string) error

CreateEpisodeRecords : エピソードの視聴記録を作成

func (*API) CreateWorkReview

func (a *API) CreateWorkReview(workID, body string, overall, movie, chara, story, music gen.RatingState) error

CreateWorkReview : 作品のレビューを作成

func (*API) FetchUnwatchEpisodes

func (a *API) FetchUnwatchEpisodes() ([]*gen.UnwatchLibraryEntryFragment, error)

FetchUnwatchEpisodes : 未視聴のエピソードを取得

func (*API) FetchWorkEpisodes

func (a *API) FetchWorkEpisodes(annictID int64) (*gen.WorkEpisodesFragment, error)

FetchWorkEpisodes : 作品のエピソードを取得

func (*API) FetchWorkInfo

func (a *API) FetchWorkInfo(annictID int64) (*gen.WorkInfoFragment, error)

FetchWorkInfo : 作品の詳細を取得

func (*API) SearchWorks

func (a *API) SearchWorks(q string, seasons []string, limit int64) ([]*gen.WorkFragment, error)

SearchWorks : クエリから作品を検索

func (*API) SearchWorksFromLibrary

func (a *API) SearchWorksFromLibrary(q string, states []gen.StatusState, seasons []string, limit int64) ([]*gen.WorkFragment, error)

SearchWorksFromLibrary : ライブラリ内の作品を検索

func (*API) UpdateUserToken

func (c *API) UpdateUserToken(code string) error

UpdateUserToken : ユーザートークンを更新 (再取得)

func (*API) UpdateWorkState

func (a *API) UpdateWorkState(id string, state gen.StatusState) error

UpdateWorkState : 作品の視聴ステータスを更新

type ClientToken

type ClientToken struct {
	ID     string
	Secret string
}

ClientToken : クライアントトークン

func (*ClientToken) Get

func (ct *ClientToken) Get() (string, string, error)

Get : 取得

func (*ClientToken) InEmpty

func (ct *ClientToken) InEmpty() bool

InEmpty : 値が設定されているか

func (*ClientToken) Set

func (ct *ClientToken) Set(id, secret string)

Set : 設定

type Token

type Token struct {
	Client *ClientToken
	User   *UserToken
}

Token : トークン

func (*Token) Revoke

func (t *Token) Revoke() error

Revoke : ユーザートークンを失効させる

type UserToken

type UserToken struct {
	Bearer string `json:"access_token"`
}

UserToken : ユーザートークン

Jump to

Keyboard shortcuts

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