idgames

package
v0.0.0-...-a66a7cd Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiUrl string = "https://www.doomworld.com/idgames/api/api.php"

Variables

View Source
var Mirrors = []Mirror{
	{"Gamers.org", "US", "http://www.gamers.org/pub/idgames/"},
	{"Syringa Networks", "US", "ftp://mirrors.syringanetworks.net/idgames/"},
	{"Mancubus", "US", "http://ftp.mancubus.net/pub/idgames/"},
	{"youfailit", "US", "http://youfailit.net/pub/idgames/"},
	{"Quaddicted", "DE", "https://www.quaddicted.com/files/idgames/"},
	{"University of Athens", "GR", "http://ftp.ntua.gr/mirror/idgames/idstuff/"},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiUrl string
}

type Date

type Date struct {
	time.Time
}

Date is a holder for a Time value that can be parsed from a date-only string within a JSON document.

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

type Dir

type Dir struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Dir is a directory of files in the idgames repository.

func FetchDirs

func FetchDirs(name string, cfg *Config) ([]Dir, error)

FetchDirs returns a list of directories in the given path.

type File

type File struct {
	ID int `json:"id"`

	Author      stringy `json:"author"`
	Date        *Date   `json:"date"`
	Description string  `json:"description"`
	Directory   string  `json:"dir"`
	Email       string  `json:"email"`
	Filename    string  `json:"filename"`
	IdGamesURL  string  `json:"idgamesurl"`
	Rating      float32 `json:"rating"`
	Size        int     `json:"size"`
	Title       stringy `json:"title"`
	URL         string  `json:"url"`
	Votes       int     `json:"votes"`
}

File is an entry in the idgames repository.

func Fetch

func Fetch(id int, cfg *Config) (*File, error)

Fetch returns a file entry for the given file ID.

func FetchFiles

func FetchFiles(path string, cfg *Config) ([]File, error)

FetchFiles returns a list of files in the given path.

func (File) GetMirrorURL

func (f File) GetMirrorURL(mirror string) string

GetMirrorURL returns a URL for this file, given an appropriate idgames mirror URL.

type Mirror

type Mirror struct {
	Name        string
	CountryCode string
	URL         string
}

Jump to

Keyboard shortcuts

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