Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("hash not found")
ErrNotFound is the error returned when a rom can't be found in the soruce.
Functions ¶
func DefaultCachePath ¶
DefaultCachePath returns the path used for all cached data. Current <HOME>/.sselph-scraper or <HOMEDIR>\Application Data\sselph-scraper
Types ¶
type DS ¶
type DS interface { // GetName takes the path of a ROM and returns the Pretty name if it differs from the Sources normal name. GetName(string) string // GetGame takes an id and returns the Game. GetGame(string) (*Game, error) // GetID takes the path of a ROM and returns the id to use in GetGame. GetID(string) (string, error) }
DS is the interface all DataSoures should implement.
type Daphne ¶ added in v1.1.3
type Daphne struct {
HM *HashMap
}
Daphne is a data source using GDB for Daphne games.
type Game ¶
type Game struct { ID string Source string GameTitle string Overview string Images map[ImgType]string Thumbs map[ImgType]string Rating float64 ReleaseDate string Developer string Publisher string Genre string Players int64 }
Game is the standard Game that all sources will return. They don't have to populate all values.
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
HashMap a mapping of hash to names and GDB IDs.
func CachedHashMap ¶
CachedHashMap gets the mapping of hashes to IDs.
func FileHashMap ¶
FileHashMap creates a hash map from a csv file.
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher is a thread-safe object to hash files. Hashes are cached and multiple calls to hash the same file wait for the first call to complete to read from cache.
type ImgType ¶
type ImgType string
ImgType represents the different image types that sources may provide.
const ( ImgBoxart ImgType = "b" ImgBoxart3D ImgType = "3b" ImgScreen ImgType = "s" ImgFanart ImgType = "f" ImgBanner ImgType = "a" ImgLogo ImgType = "l" ImgTitle ImgType = "t" ImgMarquee ImgType = "m" ImgCabinet ImgType = "c" )
Image types for Datasource options. Not all types are valid for all sources.
type LangType ¶ added in v1.1.9
type LangType string
LangType represents the different language types that sources may provide.
type MAME ¶
type MAME struct {
// contains filtered or unexported fields
}
MAME is a Data Source using mamedb and arcade-history.
type NeoGeo ¶ added in v1.1.4
type NeoGeo struct {
HM *HashMap
}
NeoGeo is a data source using GDB for Daphne games.
type OVGDB ¶
type OVGDB struct { Hasher *Hasher // contains filtered or unexported fields }
OVGDB is a DataSource using OpenVGDB.
type RegionType ¶ added in v1.1.9
type RegionType string
RegionType represents the different region types that sources may provide.
const ( RegionUnknown RegionType = "" RegionUS RegionType = "us" RegionEU RegionType = "eu" RegionFR RegionType = "fr" RegionJP RegionType = "jp" RegionXX RegionType = "xx" )
Region types for Datasource options. Not all types are valid for all sources.
type SS ¶ added in v1.1.9
type SS struct { HM *HashMap Hasher *Hasher Dev ss.DevInfo User ss.UserInfo Lang []LangType Region []RegionType Width int }
SS is the source for ScreenScraper