kitsu

package
v0.0.0-...-b9cb2e6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL *url.URL

	OAuth APIClientOAuth
	// contains filtered or unexported fields
}

func GetAPIClient

func GetAPIClient(tokenId string) *APIClient

func GetSystemKitsu

func GetSystemKitsu() *APIClient

func NewAPIClient

func NewAPIClient(conf *APIClientConfig) *APIClient

func (APIClient) GetAnimeTypeByIds

func (c APIClient) GetAnimeTypeByIds(params *GetAnimeTypeByIdsParams) (APIResponse[map[int]AnimeSubtype], error)

func (APIClient) Request

func (c APIClient) Request(method, path string, params request.Context, v ResponseContainer) (*http.Response, error)

type APIClientConfig

type APIClientConfig struct {
	HTTPClient *http.Client
	OAuth      APIClientConfigOAuth
}

type APIClientConfigOAuth

type APIClientConfigOAuth struct {
	Config         oauth2.Config
	GetTokenSource func(oauth2.Config) oauth2.TokenSource
}

type APIClientOAuth

type APIClientOAuth struct {
	Config oauth2.Config
	// contains filtered or unexported fields
}

type APIResponse

type APIResponse[T any] struct {
	Header     http.Header
	StatusCode int
	Data       T
}

type AnimeSubtype

type AnimeSubtype string
const (
	AnimeSubtypeMovie   AnimeSubtype = "movie"
	AnimeSubtypeMusic   AnimeSubtype = "music"
	AnimeSubtypeONA     AnimeSubtype = "ONA"
	AnimeSubtypeOVA     AnimeSubtype = "OVA"
	AnimeSubtypeSpecial AnimeSubtype = "special"
	AnimeSubtypeTV      AnimeSubtype = "TV"
)

type Ctx

type Ctx = request.Ctx

type GetAnimeTypeByIdsParams

type GetAnimeTypeByIdsParams struct {
	Ctx
	Ids []int
}

type ResponseContainer

type ResponseContainer interface {
	GetError(res *http.Response) error
	Unmarshal(res *http.Response, body []byte, v any) error
}

type ResponseError

type ResponseError struct {
	Err     string `json:"error,omitempty"`
	ErrDesc string `json:"error_description,omitempty"`
}

func (*ResponseError) Error

func (e *ResponseError) Error() string

func (*ResponseError) GetError

func (r *ResponseError) GetError(res *http.Response) error

func (*ResponseError) Unmarshal

func (r *ResponseError) Unmarshal(res *http.Response, body []byte, v any) error

Jump to

Keyboard shortcuts

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