annict

package
v0.0.0-...-629263a Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOAuth2Config

func NewOAuth2Config(config *config.Config) *oauth2.Config

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, httpClient *http.Client, config *config.Config) (*Client, error)

func (*Client) FetchAllWorks

func (c *Client) FetchAllWorks(ctx context.Context) ([]Work, error)

func (*Client) FetchLibrary

func (c *Client) FetchLibrary(ctx context.Context, states []status.AnnictStatusState, after string, first int) (*LibraryQuery, error)

func (*Client) FetchViewer

func (c *Client) FetchViewer(ctx context.Context) (*ViewerQuery, error)

type Episode

type Episode struct {
	ViewerDidTrack bool `graphql:"viewerDidTrack"`
}

type EpisodeConnection

type EpisodeConnection struct {
	Edges []EpisodeEdge `graphql:"edges"`
}

type EpisodeEdge

type EpisodeEdge struct {
	Node Episode `graphql:"node"`
}

type LibraryEntry

type LibraryEntry struct {
	Work Work `graphql:"work"`
}

type LibraryEntryConnection

type LibraryEntryConnection struct {
	Edges    []LibraryEntryEdge `graphql:"edges"`
	PageInfo PageInfo           `graphql:"pageInfo"`
}

type LibraryEntryEdge

type LibraryEntryEdge struct {
	Node LibraryEntry `graphql:"node"`
}

type LibraryQuery

type LibraryQuery struct {
	Viewer struct {
		LibraryEntries LibraryEntryConnection `graphql:"libraryEntries(after: $after, first: $first, states: $states)"`
	} `graphql:"viewer"`
}

type PageInfo

type PageInfo struct {
	HasNextPage bool   `graphql:"hasNextPage"`
	EndCursor   string `graphql:"endCursor"`
}

type StatusState

type StatusState status.AnnictStatusState

type User

type User struct {
	Name     string `graphql:"name"`
	Username string `graphql:"username"`
}

type ViewerQuery

type ViewerQuery struct {
	Viewer User `graphql:"viewer"`
}

type Work

type Work struct {
	AnnictID          int                      `graphql:"annictId"`
	MALAnimeID        string                   `graphql:"malAnimeId"`
	SyobocalTID       int                      `graphql:"syobocalTid"`
	Title             string                   `graphql:"title"`
	ViewerStatusState status.AnnictStatusState `graphql:"viewerStatusState"`
	NoEpisodes        bool                     `graphql:"noEpisodes"`
	Episodes          EpisodeConnection        `graphql:"episodes"`
}

Jump to

Keyboard shortcuts

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