api

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIBaseURL, _ = url.Parse(`https://api.mangadex.org/`)

Functions

This section is empty.

Types

type AtHome

type AtHome struct {
	Result  string
	BaseURL string
	Chapter struct {
		Hash      string
		Data      []string
		DataSaver []string
	}
}

type AuthorData

type AuthorData struct {
	ID         string
	Type       string
	Attributes struct {
		Name      string
		ImageUrl  string
		Biography Localized
		Twitter   string
		Pixiv     string
		MelonBook string
		FanBox    string
		Booth     string
		NicoVideo string
		Skeb      string
		Fantia    string
		Tumblr    string
		Youtube   string
		Weibo     string
		Naver     string
		Website   string
		Version   int
		CreatedAt time.Time
		UpdatedAt time.Time
	}
	Relationships Relationships
}

type AuthorList

type AuthorList struct {
	Result   string
	Response string
	Data     []AuthorData
	Limit    int
	Offset   int
	Total    int
}

type Chapter

type Chapter struct {
	Result   string
	Response string
	Data     ChapterData
}

type ChapterData

type ChapterData struct {
	ID         string
	Type       string
	Attributes struct {
		Title              string
		Volume             string
		Chapter            string
		Pages              int
		TranslatedLanguage string
		Uploader           string
		ExternalURL        string
		Version            int
		CreatedAt          time.Time
		UpdatedAt          time.Time
		PublishAt          time.Time
		ReadableAt         time.Time
	}
	Relationships Relationships
}

type ChapterList

type ChapterList struct {
	Result   string
	Response string
	Data     []ChapterData
	Limit    int
	Offset   int
	Total    int
}

type Client

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

func NewClient

func NewClient() *Client

func (*Client) GetAtHome

func (c *Client) GetAtHome(ctx context.Context, chapterID string) (*AtHome, error)

func (*Client) GetAuthors

func (c *Client) GetAuthors(ctx context.Context, args QueryArgs) (*AuthorList, error)

func (*Client) GetCovers

func (c *Client) GetCovers(ctx context.Context, args QueryArgs) (*CoverList, error)

func (*Client) GetFeed

func (c *Client) GetFeed(ctx context.Context, mangaID string, args QueryArgs) (*ChapterList, error)

func (*Client) GetGroups

func (c *Client) GetGroups(ctx context.Context, args QueryArgs) (*GroupList, error)

func (*Client) GetManga

func (c *Client) GetManga(ctx context.Context, mangaID string) (*Manga, error)

func (*Client) PostIDMapping

func (c *Client) PostIDMapping(ctx context.Context, tp string, legacyIDs ...int) (*IDMappingList, error)

func (*Client) WithBaseURL

func (c *Client) WithBaseURL(url url.URL) *Client

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(http *http.Client) *Client

type Cover

type Cover struct {
	Result   string
	Response string
	Data     CoverData
}

type CoverData

type CoverData struct {
	ID         string
	Type       string
	Attributes struct {
		Volume      string
		FileName    string
		Description string
		Locale      string
		Version     int
		CreatedAt   string
		UpdatedAt   string
	}
	Relationships Relationships
}

type CoverList

type CoverList struct {
	Result   string
	Response string
	Data     []CoverData
	Limit    int
	Offset   int
	Total    int
}

type ErrorData

type ErrorData struct {
	Context string
	Detail  string
	ID      string
	Status  int
	Title   string
}

type Errors

type Errors struct {
	Errors []ErrorData
	Result string
}

type Group

type Group struct {
	Result   string
	Response string
	Data     GroupData
}

type GroupData

type GroupData struct {
	ID         string
	Type       string
	Attributes struct {
		Name             string
		AltNames         []Localized
		Website          string
		IRCServer        string
		IRCChannel       string
		Discord          string
		ContactEmail     string
		Description      string
		Twitter          string
		MangaUpdates     string
		FocusedLanguages []string
		Locked           bool
		Official         bool
		Inactive         bool
		Verified         bool
		PublishDelay     int
		Leader           Relationship
		Members          Relationships
		Version          int
		CreatedAt        time.Time
		UpdatedAt        time.Time
	}
	Relationships Relationships
}

type GroupList

type GroupList struct {
	Result   string
	Response string
	Data     []GroupData
	Limit    int
	Offset   int
	Total    int
}

type IDMappingData

type IDMappingData struct {
	ID         string
	Type       string
	Attributes struct {
		LegacyID int
		NewID    string
		Type     string
	}
	Relationships Relationships
}

type IDMappingList

type IDMappingList struct {
	Result   string
	Response string
	Data     []IDMappingData
	Limit    int
	Offset   int
	Total    int
}

type Localized

type Localized map[string]string

func (*Localized) UnmarshalJSON

func (l *Localized) UnmarshalJSON(data []byte) error

type Manga

type Manga struct {
	Result   string
	Response string
	Data     MangaData
}

type MangaData

type MangaData struct {
	ID         string
	Type       string
	Attributes struct {
		Title                          Localized
		AltTitles                      []Localized
		Description                    Localized
		IsLocked                       bool
		Links                          map[string]string
		OriginalLanguage               string
		LastVolume                     string
		LastChapter                    string
		PublicationDemographic         string
		Status                         string
		Year                           int
		ContentRating                  string
		ChapterNumbersResetOnNewVolume bool
		Tags                           Relationships
		State                          string
		Version                        int
		CreatedAt                      time.Time
		UpdatedAt                      time.Time
	}
	Relationships Relationships
}

type QueryArgs

type QueryArgs struct {
	IDs           []string          `url:"ids"`
	Languages     []language.Tag    `url:"translatedLanguage"`
	Mangas        []string          `url:"manga"`
	Order         map[string]string `url:"order"`
	Limit         int               `url:"limit"`
	Offset        int               `url:"offset"`
	EmptyPages    string            `url:"includeEmptyPages"`
	FuturePublish string            `url:"includeFuturePublishAt"`
	ExternalURL   string            `url:"includeExternalUrl"`
}

func (QueryArgs) Values

func (a QueryArgs) Values() url.Values

type Relationship

type Relationship struct {
	ID         string
	Type       string
	Attributes map[string]interface{}
}

type Relationships

type Relationships struct {
	Manga      []string
	Chapter    []string
	Author     []string
	Artist     []string
	Group      []string
	Tag        []string
	User       []string
	CustomList []string
	CoverArt   []string
	Leader     []string
	Member     []string
	Creator    []string
}

func (*Relationships) UnmarshalJSON

func (rs *Relationships) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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