kamiext

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

README

KamiExt

KamiReader Extension basic methods to use in extensions. Here follow the guide on how to use it, if you want to make an extension witouth using kamiext scroll down.

KamiExt provide easy and type safe methods to make an extension. Just follow the template inside "template/extension.go" in this repository.

TLDR for users that doesn't have to use KamiExt

  • Commands are executed by KamiExt as a normal CLI program. You will take input in this format:
    'your_program.exe CommandName --arg_name argdata --arg_name2 argdata2'
    
  • Different methods receive different arguments in different types:
    • GetComicByHandle:
      sourceid        string
      comic_handle    string
      
    • SearchComicByTitle:
      sourceid        string
      title           string
      
    • GetPagesByChapterHandle:
      sourceid        string
      chapter_handle  string
      
    • GetPageByHandle:
      sourceid        string
      page_handle     string
      
  • Data should be sent back to standard output in json format. The json response is command dependant but the "data" key is were you put the response, the "error" key is where you put the error string (this will change in the future) and the "dataversion" key is where you write the current DataVersion (current version is "1.0"). Here is the current different responses (You could also check types.go):
    • GetComicByHandle:
      {
          "data":{
              "title":"",
              "id":"",
              "url":"",
              "comictype":"",
              "releasestatus":"",
              "summary":"",
              "cover":"",
              "authors":"",
              "artists":"",
              "altnames":"",
              "genres":"",
              "year":"",
              "chapters":[
                  {
                      "name":"",
                      "number":"",
                      "timestamp":"",
                      "handle":"",
                      "pages":[""]
                  }
              ]
          },
          "error":""
      }
      
    • SearchComicByTitle:
      {
          "data": {
              "title":"",
              "id":"",
              "handle":"",
              "cover":""
          },
          "error":""
      }
      
    • GetPagesByChapterHandle:
      {
          "data": [""],
          "error":""
      }
      
    • GetPageByHandle:
      {
          "data": "base64_encoded_image",
          "error":""
      }
      

Documentation

Index

Constants

View Source
const DATAVERSION = "1.0"

Variables

This section is empty.

Functions

func NewExtension added in v0.0.7

func NewExtension() *ext

Types

type Chapter

type Chapter struct {
	Name      string   `json:"name"`
	Number    string   `json:"number"`
	Timestamp int      `json:"timestamp"`
	Handle    string   `json:"handle"`
	Pages     []string `json:"pages"`
}

type Comic

type Comic struct {
	Title         string    `json:"title"`
	Id            string    `json:"id"`
	Url           string    `json:"url"`
	ComicType     string    `json:"comictype"`
	ReleaseStatus string    `json:"releasestatus"`
	Summary       string    `json:"summary"`
	Cover         string    `json:"cover"`
	Authors       []string  `json:"authors"`
	Artists       []string  `json:"artists"`
	Altnames      []string  `json:"altnames"`
	Genres        []string  `json:"genres"`
	Year          string    `json:"year"`
	Chapters      []Chapter `json:"chapters"`
}

type Extension

type Extension struct {
	Name            string   `json:"name"`
	ExtensionId     string   `json:"id"`
	Author          string   `json:"author"`
	ExtensionSource string   `json:"source"`
	Sources         []Source `json:"sources"`
	Executable      string   `json:"executable"`
	UpdatesUrl      string   `json:"updatesurl"`
	Updater         string   `json:"updater"`
	Version         string   `json:"version"`
}

type ExtensionSetup added in v0.0.3

type ExtensionSetup struct {
	Name       string `json:"name"`
	Author     string `json:"author"`
	Source     string `json:"source"`
	UpdatesUrl string `json:"updatesurl"`
	Updater    string `json:"updater"`
	Version    string `json:"version"`
}

type GetComicByHandleResponse added in v0.0.9

type GetComicByHandleResponse struct {
	Data        Comic  `json:"data"`
	Error       string `json:"error"`
	DataVersion string `json:"dataversion"`
}

func GetComicByHandleError added in v0.0.9

func GetComicByHandleError(err string) GetComicByHandleResponse

error public methods

func GetComicByHandleResult added in v0.0.9

func GetComicByHandleResult(result Comic) GetComicByHandleResponse

result public methods

type GetPageByHandleResponse added in v0.0.9

type GetPageByHandleResponse struct {
	Data        string `json:"data"`
	Error       string `json:"error"`
	DataVersion string `json:"dataversion"`
}

func GetPageByHandleError added in v0.0.9

func GetPageByHandleError(err string) GetPageByHandleResponse

func GetPageByHandleResult added in v0.0.9

func GetPageByHandleResult(result string) GetPageByHandleResponse

type GetPagesByChapterHandleResponse added in v0.0.9

type GetPagesByChapterHandleResponse struct {
	Data        []string `json:"data"`
	Error       string   `json:"error"`
	DataVersion string   `json:"dataversion"`
}

func GetPagesByChapterHandleError added in v0.0.9

func GetPagesByChapterHandleError(err string) GetPagesByChapterHandleResponse

func GetPagesByChapterHandleResult added in v0.0.9

func GetPagesByChapterHandleResult(result []string) GetPagesByChapterHandleResponse

type Response

type Response struct {
	Data        any    `json:"data"`
	Error       string `json:"error"`
	DataVersion string `json:"dataversion"`
}

type SearchComic

type SearchComic struct {
	Title  string `json:"title"`
	Id     string `json:"id"`
	Handle string `json:"handle"`
	Cover  string `json:"cover"`
}

type SearchComicByTitleResponse added in v0.0.9

type SearchComicByTitleResponse struct {
	Data        []SearchComic `json:"data"`
	Error       string        `json:"error"`
	DataVersion string        `json:"dataversion"`
}

func SearchComicByTitleError added in v0.0.9

func SearchComicByTitleError(err string) SearchComicByTitleResponse

func SearchComicByTitleResult added in v0.0.9

func SearchComicByTitleResult(result []SearchComic) SearchComicByTitleResponse

type Source

type Source struct {
	Name        string   `json:"name"`
	Methods     []string `json:"methods"`
	Id          string   `json:"id"`
	Domain      string   `json:"domain"`
	ExtensionId string   `json:"extensionid"`
}

type SourceSetup added in v0.0.3

type SourceSetup struct {
	Name    string   `json:"name"`
	Domain  string   `json:"domain"`
	Methods []string `json:"methods"`
	Id      string   `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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