Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListSites ¶
func ListSites() []string
ListSites returns the names of all registered site handlers.
Types ¶
type FlashpointClient ¶
type FlashpointClient struct {
// contains filtered or unexported fields
}
FlashpointClient looks up games in the Flashpoint Archive database.
func NewFlashpointClient ¶
func NewFlashpointClient() *FlashpointClient
func (*FlashpointClient) Lookup ¶
func (fp *FlashpointClient) Lookup(title, sourceURL string) *FlashpointMatch
Lookup searches Flashpoint for a game by title and source URL, returning the best match or nil if nothing matched well enough.
type FlashpointMatch ¶
type FlashpointMatch struct {
ID string
Title string
Developer string
Source string // original page URL
Platform string
}
FlashpointMatch holds metadata from a confirmed Flashpoint Archive entry.
type Game ¶
type Game struct {
Title string
Source string // human-readable site name
URL string // the original URL provided by the user
Files []GameFile // at least one entry
Flashpoint *FlashpointMatch // nil if no Flashpoint match found
}
Game holds metadata about a discovered game and its downloadable files.
type GameFile ¶
type GameFile struct {
Name string // display name (e.g. "Game.swf" or "Windows build")
URL string // direct download URL
Size int64 // content length in bytes, 0 if unknown
Filename string // suggested filename on disk
}
GameFile represents a single downloadable file for a game.
type Site ¶
type Site interface {
// Name returns a short human-readable label like "Newgrounds".
Name() string
// Match reports whether the given URL belongs to this site.
Match(u *url.URL) bool
// Resolve fetches game metadata and download links for the given URL.
Resolve(rawURL string) (*Game, error)
}
Site knows how to detect and resolve game downloads from a particular host.
Click to show internal directories.
Click to hide internal directories.