Documentation ¶
Index ¶
- type Resource
- func (r *Resource) Breadcrumbs() ([]string, error)
- func (r *Resource) Doc() (*goquery.Document, error)
- func (r *Resource) Game() (string, error)
- func (r *Resource) ID() (int, error)
- func (r *Resource) Timestamp() (string, error)
- func (r *Resource) Title() (string, error)
- func (r *Resource) URL() (string, bool)
- func (r *Resource) Updated() (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Represents all the data to be fetched related to a given mod. Used to cache the data, instead of repeatedly accessing it again and again.
Initialise using ResourceFromID or ResourceFromURL.
Get values using the methods named after the fields.
func ResourceFromID ¶
func ResourceFromID[T constraints.Integer](id T) Resource
func ResourceFromURL ¶
func (*Resource) Breadcrumbs ¶
The stuff above the workshop title, e.g. "Game> Workshop > User's Workshop" for a single entry.
func (*Resource) Doc ¶
If already fetched, it'll reuse the version stored in memory. Otherwise, it'll download the page, parse it into a Goquery document and store that in memory, then give it to you.
func (*Resource) ID ¶
If and ID has been given, it will return that. Otherwise, it will attempt to parse it from the given URL.
Click to show internal directories.
Click to hide internal directories.