Go to file
Felipe M cfc44ae669
Version bump: 1.0.1
2021-02-21 22:19:33 +01:00
test_outputs Added test JSON files 2021-02-05 11:12:58 +01:00
.gitignore Restructured code 2021-02-12 14:26:08 +01:00
LICENSE Added LICENSE 2021-02-13 13:01:01 +01:00
README.md Version bump: 1.0.0 2021-02-13 13:04:50 +01:00
cache.go Naming refactor. Added comments. 2021-02-13 12:49:16 +01:00
go.mod code.fmartingr.dev -> github.com 2021-02-13 13:01:31 +01:00
go.sum Logging improvements 2021-02-06 18:31:15 +01:00
http.go Version bump: 1.0.1 2021-02-21 22:19:33 +01:00
public.go Naming refactor. Added comments. 2021-02-13 12:49:16 +01:00
types.go Naming refactor. Added comments. 2021-02-13 12:49:16 +01:00

README.md

go-mangadex

Mangadex API client in Golang.

Stable version under stable branch. Latest development under latest branch.

Usage

import (
    "log"

    "github.com/fmartingr/go-mangadex"
)

func main() {
    // Retrieve manga information
    manga, err := mangadex.GetManga(123)
    if errManga != nil {
        log.Println("Error retrieving manga: %s", errManga)
    }

    // Retrieve a list of chapters 
    chaptersRequest := NewGetChaptersParams()
    chapters, errChapterList = manga.getChapters(chaptersRequest)
    if errChapterList != nil {
        log.Println("Error retrieving chapters page %d: %s", chaptersRequest.Page, errChapterList)
    }
        
    // Disables chache reads for requests beyond this point
    mangadex.DisableCache()

    // Retrieve a specific chapter detail
    // This will return more information than the list (the pages, server, etc)
    chapter, err := manga.GetChapter(1)
    if errChapter != nil {
        log.Println("Error retrieving chapter: %s", errChapter)
    }

    // Re-enables the cache
    mangadex.EnableCache()

    // Get all covers for this manga
    covers, errCovers := manga.GetCovers()
    if errCovers != nil {
        log.Println("Error retreiving covers: %s", errCovers)
    }
}