ss

package
v1.5.0-pre Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is the error returned when a ROM isn't found.

Functions

func ObfuscateDevInfo added in v1.4.0

func ObfuscateDevInfo(info DevInfo) (string, error)

func SanitizeURL added in v1.2.1

func SanitizeURL(s string) string

func Threads added in v1.2.1

func Threads(ctx context.Context, dev DevInfo, user UserInfo) int

Types

type DevInfo

type DevInfo struct {
	ID       string
	Password string
	Name     string
}

DevInfo is the information about the developer and used across APIs.

func DeobfuscateDevInfo added in v1.2.0

func DeobfuscateDevInfo() (info DevInfo, err error)

type Game

type Game struct {
	ID           string            `json:"id"`
	Names        []RegionAndText   `json:"noms"`
	Descriptions []LanguageAndText `json:"synopsis"`
	Publisher    IDAndText         `json:"editeur"`
	Developer    IDAndText         `json:"developpeur"`
	Players      TextField         `json:"joueurs"`
	Rating       TextField         `json:"note"`
	Dates        []RegionAndText   `json:"dates"`
	Genres       []Genre           `json:"genres"`
	Medias       []Medium          `json:"medias"`
	ROMs         []ROM             `json:"roms"`
	// contains filtered or unexported fields
}

func (Game) Date added in v1.2.1

func (g Game) Date(r []string) (string, bool)

func (Game) Desc

func (g Game) Desc(l []string) (string, bool)

func (Game) Genre

func (g Game) Genre(l []string) (string, bool)

func (Game) Media

func (game Game) Media(mediaType MediaType, regions []string) (string, bool)

func (Game) MediaWithFormat

func (game Game) MediaWithFormat(mediaType MediaType, regions []string) (string, string, bool)

func (Game) Name

func (g Game) Name(r []string) (string, bool)

func (Game) ROM added in v1.2.1

func (g Game) ROM(req GameInfoReq) (ROM, bool)

type GameInfoReq

type GameInfoReq struct {
	Name    string
	SHA1    string
	RomType string
}

GameInfoReq is the information we use in the GameInfo command.

type GameInfoResp

type GameInfoResp struct {
	Response Response `json:"response"`
}

func GameInfo

func GameInfo(ctx context.Context, dev DevInfo, user UserInfo, req GameInfoReq) (*GameInfoResp, error)

GameInfo is the call to get game info.

type Genre

type Genre struct {
	ID    string            `json:"id"`
	Names []LanguageAndText `json:"noms"`
}

type IDAndText

type IDAndText struct {
	ID   string `json:"id"`
	Text string `json:"text"`
}

type LanguageAndText

type LanguageAndText struct {
	Language string `json:"langue"`
	Text     string `json:"text"`
}

type MediaType

type MediaType string
const (
	Screenshot    MediaType = "ss"
	ScreenMarquee MediaType = "screenmarquee"
	Marquee       MediaType = "marquee"
	Video         MediaType = "video"
	Box2D         MediaType = "box-2D"
	Box3D         MediaType = "box-3D"
	Flyer         MediaType = "flyer"
	Wheel         MediaType = "wheel"
	Support2D     MediaType = "support-2D"
	SupportLabel  MediaType = "support-texture"
)

type Medium

type Medium struct {
	Type   MediaType `json:"type"`
	Parent string    `json:"parent"`
	URL    string    `json:"url"`
	Format string    `json:"format"`
	Region string    `json:"region"`
}

type ROM added in v1.2.1

type ROM struct {
	FileName   string `json:"romfilename"`
	SHA1       string `json:"romsha1"`
	RegionsRaw string `json:"romregions"`
}

func (ROM) Regions added in v1.2.1

func (r ROM) Regions() []string

type RegionAndText

type RegionAndText struct {
	Region string `json:"region"`
	Text   string `json:"text"`
}

type Response added in v1.2.1

type Response struct {
	Game Game `json:"jeu"`
}

type TextField

type TextField struct {
	Text string `json:"text"`
}

type UserInfo

type UserInfo struct {
	ID       string
	Password string
}

UserInfo is information about the user making the call.

type UserInfoResp added in v1.2.1

type UserInfoResp struct {
	ID              string `xml:"ssuser>id"`
	Level           int    `xml:"ssuser>niveau"`
	Contribution    int    `xml:"ssuser>contribution"`
	UploadedSystems int    `xml:"ssuser>uploadsysteme"`
	UploadedInfo    int    `xml:"ssuser>uploadinfos"`
	ROMsAssociated  int    `xml:"ssuser>romasso"`
	UpdatedMedia    int    `xml:"ssuser>uploadmedia"`
	FavoriteRegion  string `xml:"ssuser>favregion"`
	MaxThreads      int    `xml:"ssuser>maxthreads"`
}

func User added in v1.2.1

func User(ctx context.Context, dev DevInfo, user UserInfo) (*UserInfoResp, error)

Jump to

Keyboard shortcuts

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