Documentation ¶
Index ¶
- Variables
- func DefaultCachePath() (string, error)
- func Draw(ctx context.Context, def *Def, width, height int) (image.Image, error)
- type ADB
- type DS
- type Daphne
- type Def
- type Element
- type GDB
- type Game
- type HTTPImage
- type HTTPImageSS
- type HTTPVideo
- type HTTPVideoSS
- type HashMap
- type Hasher
- type Image
- type ImgType
- type MAME
- type MixImage
- type NeoGeo
- type OVGDB
- type PreDefValue
- type SS
- type SSMAME
- type ScummVM
- type Value
- type VidType
- type Video
Constants ¶
This section is empty.
Variables ¶
var ErrImgNotFound = errors.New("image not found")
ErrImgNotFound is the error returned when a rom image can't be found.
var ErrNotFound = errors.New("hash not found")
ErrNotFound is the error returned when a rom can't be found in the source.
Functions ¶
func DefaultCachePath ¶
DefaultCachePath returns the path used for all cached data. Current <HOME>/.sselph-scraper or <HOMEDIR>\Application Data\sselph-scraper
Types ¶
type ADB ¶ added in v1.2.6
type ADB struct {
Limit chan struct{}
}
ADB is a Data Source using arcadeitalia and arcade-history.
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(context.Context, string) (*Game, 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 Def ¶ added in v1.3.0
Def represents the overall mix definition.
func StandardFour ¶ added in v1.3.0
StandardFour creates a Def for the Standard 4 image mix.
func StandardThree ¶ added in v1.3.0
StandardThree creates a Def for the Standard 3 image mix.
type Element ¶ added in v1.3.0
type Element struct { Image Image Width Value Height Value TopLeftX Value TopLeftY Value Fill bool }
Element represents an element in the overall image.
type Game ¶
type Game struct { ID string Source string GameTitle string Overview string Images map[ImgType]Image Thumbs map[ImgType]Image Videos map[VidType]Video Rating float64 ReleaseDate string Developer string Publisher string Genre string Players int64 CloneOf string }
Game is the standard Game that all sources will return. They don't have to populate all values.
type HTTPImage ¶ added in v1.2.1
type HTTPImage struct { URL string Limit chan struct{} }
type HTTPImageSS ¶ added in v1.2.1
type HTTPImageSS struct { URL string Limit chan struct{} }
type HTTPVideoSS ¶ added in v1.4.0
func (HTTPVideoSS) Ext ¶ added in v1.4.0
func (v HTTPVideoSS) Ext() string
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" ImgFlyer ImgType = "fly" ImgCart ImgType = "cart" ImgCartLabel ImgType = "clabel" ImgMix3 ImgType = "mix3" ImgMix4 ImgType = "mix4" )
Image types for Datasource options. Not all types are valid for all sources.
type MAME ¶
type MAME struct {
// contains filtered or unexported fields
}
MAME is a Data Source using mamedb and arcade-history.
type MixImage ¶ added in v1.3.0
type MixImage struct {
// contains filtered or unexported fields
}
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 PreDefValue ¶ added in v1.3.0
type PreDefValue int
PreDefValue are the predefined values for Values.
const ( Undefined PreDefValue = iota Center Left Right Up Down )
type SS ¶ added in v1.1.9
type SS struct { HM *HashMap Hasher *Hasher Dev ss.DevInfo User ss.UserInfo Lang []string Region []string Width int Height int Limit chan struct{} }
SS is the source for ScreenScraper
type SSMAME ¶ added in v1.2.0
type SSMAME struct { Dev ss.DevInfo User ss.UserInfo Lang []string Region []string Width int Height int Limit chan struct{} }
SSMAME is the source for ScreenScraper
type ScummVM ¶
type ScummVM struct {
HM *HashMap
}
ScummVM is a data source using GDB for ScummVM games.
type Value ¶ added in v1.3.0
type Value struct { Rel float64 Abs int PreDef PreDefValue }
Value is a value which can be absolute, relative, or a predefined short hand.