kobo

package
v1.1.1-0...-1d859d9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommandNotFound = errors.New("required command not found")

ErrCommandNotFound is thrown when a required command is not found.

Functions

func ContentIDToImageID

func ContentIDToImageID(contentID string) string

ContentIDToImageID converts the Kobo ContentId to the ImageId.

func Find

func Find() ([]string, error)

Find gets the paths to the kobos.

func IsKobo

func IsKobo(path string) bool

IsKobo checks if a path is a kobo.

func ParseKoboAffiliate

func ParseKoboAffiliate(kpath string) (affiliate string, err error)

ParseKoboAffiliate parses the affiliate from the .kobo/affiliate.conf file.

func ParseKoboVersion

func ParseKoboVersion(kpath string) (serial, version, id string, err error)

ParseKoboVersion gets the info from the .kobo/version file.

func PathToContentID

func PathToContentID(relpath string) string

PathToContentID generates the Kobo ContentId for a path relative to the internal storage root (slashes are converted to forward slashes automatically).

func VersionCompare

func VersionCompare(a, b string) int

VersionCompare compares two firmware versions. a < b = -1 a = b = 0 a > b = 1

Types

type CodeName

type CodeName string
const (
	CodeNameNone          CodeName = ""
	CodeNameDesktop       CodeName = "desktop"
	CodeNameNickel1       CodeName = "nickel1"
	CodeNameNickel2       CodeName = "nickel2"
	CodeNameMerch         CodeName = "merch"
	CodeNameVox           CodeName = "vox"
	CodeNameTrilogy       CodeName = "trilogy"
	CodeNamePixie         CodeName = "pixie"
	CodeNamePika          CodeName = "pika"
	CodeNameDragon        CodeName = "dragon"
	CodeNameDahlia        CodeName = "dahlia"
	CodeNameAlyssum       CodeName = "alyssum"
	CodeNameSnow          CodeName = "snow"
	CodeNameNova          CodeName = "nova"
	CodeNameStorm         CodeName = "storm"
	CodeNameDaylight      CodeName = "daylight"
	CodeNameSuperDaylight CodeName = "superDaylight"
	CodeNameFrost         CodeName = "frost"
	CodeNameFrost32       CodeName = "frost32"
	CodeNamePhoenix       CodeName = "phoenix"
	CodeNameKraken        CodeName = "kraken"
	CodeNameStar          CodeName = "star"
)

Codenames.

func (CodeName) String

func (c CodeName) String() string

type CodeNameTriplet

type CodeNameTriplet [3]CodeName

func (CodeNameTriplet) Class

func (c CodeNameTriplet) Class() CodeName

func (CodeNameTriplet) Family

func (c CodeNameTriplet) Family() CodeName

func (CodeNameTriplet) FamilyString

func (c CodeNameTriplet) FamilyString() string

func (CodeNameTriplet) Secondary

func (c CodeNameTriplet) Secondary() CodeName

func (CodeNameTriplet) SecondaryString

func (c CodeNameTriplet) SecondaryString() string

func (CodeNameTriplet) String

func (c CodeNameTriplet) String() string

type CoverType

type CoverType string
const (
	CoverTypeFull    CoverType = "N3_FULL"
	CoverTypeLibFull CoverType = "N3_LIBRARY_FULL"
	CoverTypeLibList CoverType = "N3_LIBRARY_LIST"
	CoverTypeLibGrid CoverType = "N3_LIBRARY_GRID"
)

Cover types.

func CoverTypes

func CoverTypes() []CoverType

func (CoverType) GeneratePath

func (c CoverType) GeneratePath(external bool, iid string) string

GeneratePath generates the path for the cover of an ImageID. The path is always separated with forward slashes.

func (CoverType) NickelString

func (c CoverType) NickelString() string

func (CoverType) Resize

func (c CoverType) Resize(target image.Point, sz image.Point) image.Point

Resize returns the dimensions to resize sz to for the cover type and target size.

func (CoverType) String

func (c CoverType) String() string

type Device

type Device int
const (
	DeviceTouchAB               Device = 310
	DeviceTouchC                Device = 320
	DeviceGlo                   Device = 330
	DeviceMini                  Device = 340
	DeviceAuraHD                Device = 350
	DeviceAura                  Device = 360
	DeviceAuraH2O               Device = 370
	DeviceGloHD                 Device = 371
	DeviceTouch2                Device = 372
	DeviceAuraONE               Device = 373
	DeviceAuraH2OEdition2v1     Device = 374
	DeviceAuraEdition2v1        Device = 375
	DeviceClaraHD               Device = 376
	DeviceForma                 Device = 377
	DeviceAuraH2OEdition2v2     Device = 378
	DeviceAuraEdition2v2        Device = 379
	DeviceForma32               Device = 380
	DeviceAuraONELimitedEdition Device = 381
	DeviceLibraH2O              Device = 384
)

Devices (not including really old ones, like Kobo eReader, Wireless, Literati, and Vox).

func DeviceByID

func DeviceByID(id string) (Device, bool)

func Devices

func Devices() []Device

func (Device) CodeNames

func (d Device) CodeNames() CodeNameTriplet

func (Device) CoverSize

func (d Device) CoverSize(t CoverType) image.Point

func (Device) CoverSized

func (d Device) CoverSized(t CoverType, orig image.Point) image.Point

func (Device) Family

func (d Device) Family() string

func (Device) Hardware

func (d Device) Hardware() Hardware

func (Device) ID

func (d Device) ID() int

func (Device) IDString

func (d Device) IDString() string

func (Device) Name

func (d Device) Name() string

func (Device) StorageGB

func (d Device) StorageGB() int

func (Device) String

func (d Device) String() string

type Hardware

type Hardware int
const (
	HardwareKobo3 Hardware = 3
	HardwareKobo4 Hardware = 4
	HardwareKobo5 Hardware = 5
	HardwareKobo6 Hardware = 6
	HardwareKobo7 Hardware = 7
)

Hardware revisions.

func (Hardware) Hardware

func (h Hardware) Hardware() int

func (Hardware) String

func (h Hardware) String() string

type UpgradeCheckResult

type UpgradeCheckResult struct {
	Data           interface{}
	ReleaseNoteURL string
	UpgradeType    UpgradeType
	UpgradeURL     string
}

UpgradeCheckResult represents an update check result from the Kobo API.

func CheckUpgrade

func CheckUpgrade(device, affiliate, curVersion, serial string) (*UpgradeCheckResult, error)

CheckUpgrade queries the Kobo API for an update.

func (UpgradeCheckResult) ParseVersion

func (u UpgradeCheckResult) ParseVersion() string

ParseVersion tries to extract the version from the UpgradeURL. It returns 0.0.0 if none is present.

type UpgradeType

type UpgradeType int

UpgradeType represents an upgrade type.

const (
	UpgradeTypeNone      UpgradeType = 0 // No upgrade available.
	UpgradeTypeAvailable UpgradeType = 1 // Optional update, but never seen this before.
	UpgradeTypeRequired  UpgradeType = 2 // Automatic update.
)

Upgrade types.

func (UpgradeType) IsUpdate

func (u UpgradeType) IsUpdate() bool

IsUpdate checks if an UpdateType signifies an available update.

func (UpgradeType) String

func (u UpgradeType) String() string

Jump to

Keyboard shortcuts

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