core

package
v0.0.0-...-d325a26 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAT

type DAT struct {
	Games []Game
}

DAT structure

func (*DAT) Deserialize

func (dat *DAT) Deserialize(data []byte) error

Deserialize DAT

func (*DAT) FromMemory

func (dat *DAT) FromMemory(system string) error

FromMemory load current instance with embedded data based on system

func (*DAT) FromXML

func (dat *DAT) FromXML(data []byte) error

FromXML builds a DAT instance from XML dat version

func (*DAT) Serialize

func (dat *DAT) Serialize() ([]byte, error)

Serialize DAT

type Game

type Game struct {
	Name        string
	CloneOf     string
	RomOf       string
	Description string
	Year        string
	Roms        []string
	Merges      []string
}

Game definition is DAT

type GameStatus

type GameStatus struct {
	Title       string
	Source      string
	Destination string
	Image       string
	Warnings    []error
	Errors      []error
}

GameStatus keeps current state of a rom treatement

type Index

type Index interface {
	Add(key string, data interface{}) error
	Search(query string) ([]SearchResult, error)
	Status() SearchStatus
	Close() error
}

Index defines indexing API

func CreateIndex

func CreateIndex(excludedPaths []string) (Index, error)

CreateIndex instanciates a new Index implementation

type Options

type Options struct {
	Region      Region
	System      System
	ImagesDir   string
	RomsDir     string
	CleanedDir  string
	KeepClones  bool
	CopyMode    bool
	FailOnError bool
}

Options defines global cleaner options

type Region

type Region string

Region defines a region code

const (
	// EUROPE region
	EUROPE Region = "EUR"
	// USA region
	USA Region = "USA"
	// JAPAN region
	JAPAN Region = "JPN"
)

func GetRegion

func GetRegion(key string) ([]Region, error)

GetRegion returns a region key baed on a key

type SearchResult

type SearchResult struct {
	Key   string
	Score float64
}

SearchResult is the returned object by an Index.Search query

type SearchStatus

type SearchStatus struct {
	Total      int
	Failed     int
	Successful int
}

SearchStatus maintains current search result status

type System

type System struct {
	ID       string
	Terms    []string
	Exts     string
	Scanners []string
	Cleaners []string
}

System defines a system

func GetSystem

func GetSystem(keyOrPath string) (System, error)

GetSystem returns a system key based on a key or path

Jump to

Keyboard shortcuts

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