Documentation ¶
Index ¶
- Variables
- func ContentIDToImageID(contentID string) string
- func Find() ([]string, error)
- func IsKobo(path string) bool
- func ParseKoboAffiliate(kpath string) (affiliate string, err error)
- func ParseKoboVersion(kpath string) (serial, version, id string, err error)
- func PathToContentID(relpath string) string
- func VersionCompare(a, b string) int
- type CodeName
- type CodeNameTriplet
- type CoverType
- type Device
- func (d Device) CodeNames() CodeNameTriplet
- func (d Device) CoverSize(t CoverType) image.Point
- func (d Device) CoverSized(t CoverType, orig image.Point) image.Point
- func (d Device) Family() string
- func (d Device) Hardware() Hardware
- func (d Device) ID() int
- func (d Device) IDString() string
- func (d Device) Name() string
- func (d Device) StorageGB() int
- func (d Device) String() string
- type Hardware
- type UpgradeCheckResult
- type UpgradeType
Constants ¶
This section is empty.
Variables ¶
var ErrCommandNotFound = errors.New("required command not found")
ErrCommandNotFound is thrown when a required command is not found.
Functions ¶
func ContentIDToImageID ¶
ContentIDToImageID converts the Kobo ContentId to the ImageId.
func ParseKoboAffiliate ¶
ParseKoboAffiliate parses the affiliate from the .kobo/affiliate.conf file.
func ParseKoboVersion ¶
ParseKoboVersion gets the info from the .kobo/version file.
func PathToContentID ¶
PathToContentID generates the Kobo ContentId for a path relative to the internal storage root (slashes are converted to forward slashes automatically).
func VersionCompare ¶
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.
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 ¶
GeneratePath generates the path for the cover of an ImageID. The path is always separated with forward slashes.
func (CoverType) NickelString ¶
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 (Device) CodeNames ¶
func (d Device) CodeNames() CodeNameTriplet
type Hardware ¶
type Hardware int
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