koreaderinspector

package module
v0.0.0-...-67aa4de Latest Latest
Warning

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

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

README ¶

KOReader HTTP Inspector Client

Go Reference Go Report Card

A Go client library for interacting with the KOReader's HTTP Inspector. This allows you to programmatically control and query your KOReader device.

📦 Installation

go get github.com/Consoleaf/koreader-http-inspector

💡 Usage

package main

import (
	"fmt"
	"log"
	koreaderinspector "github.com/Consoleaf/koreader-http-inspector"
)

func main() {
	koreaderURL := "http://192.168.15.244:8080" // Default IP for Usbnetlite. You can also use `http://localhost:8080` if running KOReader on PC

	client, err := koreaderinspector.New(koreaderURL)
	if err != nil {
		log.Fatalf("Failed to create client: %v", err)
	}

	// Example: Get KOReader's Lua version
	luaVersion, err := client.GetLuaVersion()
	if err != nil {
		log.Printf("Error getting Lua version: %v", err)
	} else {
		fmt.Printf("KOReader Lua Version: %s\n", luaVersion)
	}

	// Example: Start SSH on the device
	sshPort, err := client.SSHStart()
	if err != nil {
		log.Printf("Error starting SSH: %v", err)
	} else {
		fmt.Printf("SSH started on port: %d\n", sshPort)
	}

	// Check the source code for more available methods!
}

Documentation ¶

Overview ¶

Package koreaderinspector

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

This section is empty.

Types ¶

type HTTPClient ¶

type HTTPClient interface {
	Get(url string) (resp *http.Response, err error)
}

type HTTPInspectorClient ¶

type HTTPInspectorClient struct {
	Logger log.Logger
	// contains filtered or unexported fields
}

func New ¶

func New(baseURL string) (*HTTPInspectorClient, error)

func NewWithClient ¶

func NewWithClient(baseURL string, client HTTPClient) (*HTTPInspectorClient, error)

func (*HTTPInspectorClient) FullRefresh ¶

func (client *HTTPInspectorClient) FullRefresh() error

func (*HTTPInspectorClient) Get ¶

func (client *HTTPInspectorClient) Get(path string) ([]byte, error)

func (*HTTPInspectorClient) GetLuaVersion ¶

func (client *HTTPInspectorClient) GetLuaVersion() (string, error)

func (*HTTPInspectorClient) GetWithQuery ¶

func (client *HTTPInspectorClient) GetWithQuery(path string, query string) ([]byte, error)

func (*HTTPInspectorClient) NextPage ¶

func (client *HTTPInspectorClient) NextPage() error

func (*HTTPInspectorClient) PrevPage ¶

func (client *HTTPInspectorClient) PrevPage() error

func (*HTTPInspectorClient) RestartKOReader ¶

func (client *HTTPInspectorClient) RestartKOReader() error

func (*HTTPInspectorClient) SSHGetPort ¶

func (client *HTTPInspectorClient) SSHGetPort() (int, error)

func (*HTTPInspectorClient) SSHIsRunning ¶

func (client *HTTPInspectorClient) SSHIsRunning() (bool, error)

func (*HTTPInspectorClient) SSHStart ¶

func (client *HTTPInspectorClient) SSHStart() (int, error)

func (*HTTPInspectorClient) SSHStop ¶

func (client *HTTPInspectorClient) SSHStop() error

func (*HTTPInspectorClient) SetNightMode ¶

func (client *HTTPInspectorClient) SetNightMode(nightMode bool) error

func (*HTTPInspectorClient) ToggleNightMode ¶

func (client *HTTPInspectorClient) ToggleNightMode() error

func (*HTTPInspectorClient) TurnPageBy ¶

func (client *HTTPInspectorClient) TurnPageBy(amount int) error

type HTTPInspectorClientError ¶

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

func (HTTPInspectorClientError) Error ¶

func (error HTTPInspectorClientError) Error() string

Directories ¶

Path Synopsis
Package utils
Package utils

Jump to

Keyboard shortcuts

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