api

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

DO NOT EDIT THIS: This file was generated by the Pyrin Golang Generator

THIS FILE IS GENERATED BY PYRIN GOGEN CODE GENERATOR

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request[D any](data RequestData) (*D, error)

func RequestForm

func RequestForm[D any](data RequestData, boundary string, body Reader) (*D, error)

func Sprintf

func Sprintf(format string, a ...any) string

Simple wrapper for Sprintf

Types

type ApiError

type ApiError[E any] struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
	Extra   E      `json:"extra,omitempty"`
}

func (*ApiError[E]) Error

func (err *ApiError[E]) Error() string

type ApiResponse

type ApiResponse[D any, E any] struct {
	Success bool         `json:"success"`
	Data    D            `json:"data,omitempty"`
	Error   *ApiError[E] `json:"error,omitempty"`
}

type Bookmark

type Bookmark struct {
	ChapterId string `json:"chapterId"`
}

type ChangePasswordBody

type ChangePasswordBody struct {
	CurrentPassword    string `json:"currentPassword"`
	NewPassword        string `json:"newPassword"`
	NewPasswordConfirm string `json:"newPasswordConfirm"`
}

type Chapter

type Chapter struct {
	Id       string           `json:"id"`
	Name     string           `json:"name"`
	SerieId  string           `json:"serieId"`
	Pages    []string         `json:"pages"`
	CoverArt Images           `json:"coverArt"`
	User     *ChapterUserData `json:"user,omitempty"`
}

type ChapterUserData

type ChapterUserData struct {
	IsMarked bool `json:"isMarked"`
}

type Client

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

func New

func New(addr string) *Client

func (*Client) ChangePassword

func (c *Client) ChangePassword(body ChangePasswordBody, options Options) (*any, error)

func (*Client) ChangeSerieCover

func (c *Client) ChangeSerieCover(id string, body Reader, options Options) (*any, error)

func (*Client) CreateSerie

func (c *Client) CreateSerie(body CreateSerieBody, options Options) (*CreateSerie, error)

func (*Client) DeleteChapter

func (c *Client) DeleteChapter(id string, options Options) (*any, error)

func (*Client) DeleteSerie

func (c *Client) DeleteSerie(id string, options Options) (*any, error)

func (*Client) EditSerie

func (c *Client) EditSerie(id string, body EditSerieBody, options Options) (*any, error)

func (*Client) GetChapterById

func (c *Client) GetChapterById(id string, options Options) (*GetChapterById, error)

func (*Client) GetChapters

func (c *Client) GetChapters(options Options) (*GetChapters, error)

func (*Client) GetMe

func (c *Client) GetMe(options Options) (*GetMe, error)

func (*Client) GetSerieById

func (c *Client) GetSerieById(id string, options Options) (*GetSerieById, error)

func (*Client) GetSerieChapters

func (c *Client) GetSerieChapters(id string, options Options) (*GetSerieChapters, error)

func (*Client) GetSeries

func (c *Client) GetSeries(options Options) (*GetSeries, error)

func (*Client) GetSystemInfo

func (c *Client) GetSystemInfo(options Options) (*GetSystemInfo, error)

func (*Client) MarkChapters

func (c *Client) MarkChapters(body PostUserMarkChaptersBody, options Options) (*any, error)

func (*Client) SetToken

func (c *Client) SetToken(token string)

func (*Client) Signin

func (c *Client) Signin(body SigninBody, options Options) (*Signin, error)

func (*Client) Signup

func (c *Client) Signup(body SignupBody, options Options) (*Signup, error)

func (*Client) UnmarkChapters

func (c *Client) UnmarkChapters(body PostUserUnmarkChaptersBody, options Options) (*any, error)

func (*Client) UpdateBookmark

func (c *Client) UpdateBookmark(body PostUserUpdateBookmarkBody, options Options) (*any, error)

func (*Client) UploadChapter

func (c *Client) UploadChapter(body Reader, options Options) (*any, error)

type CreateSerie

type CreateSerie struct {
	SerieId string `json:"serieId"`
}

type CreateSerieBody

type CreateSerieBody struct {
	Name string `json:"name"`
}

type EditSerieBody

type EditSerieBody struct {
	Name      *string `json:"name,omitempty"`
	MalId     *string `json:"malId,omitempty"`
	AnilistId *string `json:"anilistId,omitempty"`
}

type GetChapterById

type GetChapterById struct {
	Id          string           `json:"id"`
	Name        string           `json:"name"`
	SerieId     string           `json:"serieId"`
	Pages       []string         `json:"pages"`
	CoverArt    Images           `json:"coverArt"`
	User        *ChapterUserData `json:"user,omitempty"`
	NextChapter *string          `json:"nextChapter,omitempty"`
	PrevChapter *string          `json:"prevChapter,omitempty"`
}

type GetChapters

type GetChapters struct {
	Chapters []Chapter `json:"chapters"`
}

type GetMe

type GetMe struct {
	Id            string  `json:"id"`
	Username      string  `json:"username"`
	Role          string  `json:"role"`
	DisplayName   string  `json:"displayName"`
	QuickPlaylist *string `json:"quickPlaylist,omitempty"`
}

type GetSerieById

type GetSerieById struct {
	Id        string         `json:"id"`
	Name      string         `json:"name"`
	CoverArt  Images         `json:"coverArt"`
	MalId     *string        `json:"malId,omitempty"`
	AnilistId *string        `json:"anilistId,omitempty"`
	User      *SerieUserData `json:"user,omitempty"`
}

type GetSerieChapters

type GetSerieChapters struct {
	Chapters []Chapter `json:"chapters"`
}

type GetSeries

type GetSeries struct {
	Series []Serie `json:"series"`
}

type GetSystemInfo

type GetSystemInfo struct {
	Version string `json:"version"`
}

type Images

type Images struct {
	Small  string `json:"small"`
	Medium string `json:"medium"`
	Large  string `json:"large"`
}

type Options

type Options struct {
	QueryParams map[string]string
	Boundary    string
}

type PostUserMarkChaptersBody

type PostUserMarkChaptersBody struct {
	Chapters []string `json:"chapters"`
}

type PostUserUnmarkChaptersBody

type PostUserUnmarkChaptersBody struct {
	Chapters []string `json:"chapters"`
}

type PostUserUpdateBookmarkBody

type PostUserUpdateBookmarkBody struct {
	SerieId   string `json:"serieId"`
	ChapterId string `json:"chapterId"`
	Page      int    `json:"page"`
}

type Reader

type Reader interface {
	Read(p []byte) (n int, err error)
}

Copy of io.Reader interface

type RequestData

type RequestData struct {
	Url    string
	Method string

	Token string
	Body  any
}

type Serie

type Serie struct {
	Id        string  `json:"id"`
	Name      string  `json:"name"`
	CoverArt  Images  `json:"coverArt"`
	MalId     *string `json:"malId,omitempty"`
	AnilistId *string `json:"anilistId,omitempty"`
}

type SerieUserData

type SerieUserData struct {
	Bookmark *Bookmark `json:"bookmark,omitempty"`
}

type Signin

type Signin struct {
	Token string `json:"token"`
}

type SigninBody

type SigninBody struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Signup

type Signup struct {
	Id       string `json:"id"`
	Username string `json:"username"`
}

type SignupBody

type SignupBody struct {
	Username        string `json:"username"`
	Password        string `json:"password"`
	PasswordConfirm string `json:"passwordConfirm"`
}

type UploadChapterBody

type UploadChapterBody struct {
	Name    string `json:"name"`
	SerieId string `json:"serieId"`
}

Jump to

Keyboard shortcuts

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