database

package
v0.0.0-...-86cf518 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package database uses SQLite to store game screenshots and CRC as an alternative to the XML file and separate PNG files used by the original C# based utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database holds the SQLite database handle and image encoding function

func NewDatabase

func NewDatabase(file string, encode func(io.Writer, image.Image) error) (*Database, error)

NewDatabase opens an existing database or returns a new empty one. An image encoding function should also be provided to encode screenshots for the target device

func (*Database) Close

func (db *Database) Close() error

Close closes the database rendering it unusable

func (*Database) FindScreenshotByCRC

func (db *Database) FindScreenshotByCRC(crc string) ([]byte, int, genre.Genre, error)

FindScreenshotByCRC searchs the database for a game matching the CRC and returns the screenshot, year and genre

func (*Database) ImportXML

func (db *Database) ImportXML(file string) error

ImportXML wipes an existing data and imports the entries from an XML file

Jump to

Keyboard shortcuts

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