tmlapi14

package
v0.0.0-...-a0b3f1d Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomMod

func GetRandomMod() string

returns a random internal mod name

Types

type Author

type Author struct {
	SteamID        uint64    `json:"steam_id"`
	SteamName      string    `json:"steam_name"`
	Mods           []ModInfo `json:"mods"`
	Total          uint32    `json:"total"`
	TotalDownloads uint64    `json:"total_downloads"`
	TotalFavorites uint64    `json:"total_favorites"`
	TotalViews     uint64    `json:"total_views"`
}

func GetAuthorInfo

func GetAuthorInfo(steamid64 string) (Author, error)

type ModChild

type ModChild struct {
	File_type       uint32 `json:"file_type"`
	Publishedfileid string `json:"publishedfileid"`
	Sortorder       uint32 `json:"sortorder"`
}

type ModInfo

type ModInfo struct {
	DisplayName        string           `json:"display_name"`
	InternalName       string           `json:"internal_name"`
	ModID              string           `json:"mod_id"`
	Author             string           `json:"author"`
	AuthorID           string           `json:"author_id"`
	ModSide            string           `json:"modside"`
	Homepage           string           `json:"homepage"`
	Versions           []ModVersionData `json:"versions"`
	ModReferences      string           `json:"mod_references"`
	NumVersions        uint32           `json:"num_versions"`
	Tags               []ModTag         `json:"tags"`
	TimeCreated        uint64           `json:"time_created"`
	TimeUpdated        uint64           `json:"time_updated"`
	IconUrl            string           `json:"workshop_icon_url"`
	DownloadsTotal     uint32           `json:"downloads_total"`
	Favorited          uint32           `json:"favorited"`
	Followers          uint32           `json:"followers"`
	Views              uint64           `json:"views"`
	VoteData           *ModVoteData     `json:"vote_data"`
	Playtime           string           `json:"playtime"`
	DisplayNameHTML    template.HTML    // added later
	Description        string           `json:"description"`
	EscapedDescription template.HTML    // added later
	Children           []ModChild       `json:"children"`
}

ModInfo holds mod info that is fetched from tmlapis.tomat.dev/1.4/mod

func GetModInfo

func GetModInfo(modName string) (ModInfo, error)

requires a internal modName

func GetModList

func GetModList() []ModInfo

type ModTag

type ModTag struct {
	Tag         string `json:"tag"`
	DisplayName string `json:"display_name"`
}

type ModVersionData

type ModVersionData struct {
	ModVersion        string `json:"mod_version"`
	TmodloaderVersion string `json:"tmodloader_version"`
}

type ModVoteData

type ModVoteData struct {
	Score     float64 `json:"score"`
	VotesUp   uint32  `json:"votes_up"`
	VotesDown uint32  `json:"votes_down"`
}

Jump to

Keyboard shortcuts

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