Documentation
¶
Overview ¶
Package metadata extracts mod metadata from well-known files inside a mod directory (e.g. 7 Days to Die's ModInfo.xml). Adding a format means adding one Reader implementation and listing it in readers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
Info is metadata extracted from a well-known mod metadata file. Zero-value fields mean the file did not provide them.
func Resolve ¶
Resolve extracts metadata from modDir using the first matching reader. Returns nil when no known metadata file exists or it cannot be parsed; callers fall back to name-based detection.
func ResolveArchive ¶
ResolveArchive extracts metadata from a .zip or .jar archive whose ModInfo.xml lives at the archive root or exactly one directory deep - the common "wrapper folder" layout used by 7 Days to Die mods (e.g. a donovan-aio.zip containing donovan-aio/ModInfo.xml). Returns nil when the archive can't be opened, has no ModInfo.xml, or the metadata is malformed; callers fall back to filename-based detection, mirroring Resolve.
type ModInfoXML ¶
type ModInfoXML struct{}
ModInfoXML reads 7 Days to Die ModInfo.xml files. Two layouts exist: V2 puts fields directly under <xml>; V1 nests them in <ModInfo>.
func (ModInfoXML) Detect ¶
func (ModInfoXML) Detect(modDir string) string
Detect implements Reader. Matching is case-insensitive (strings.EqualFold) to mirror findModInfoEntry's archive-path handling: some mod packagers ship lowercase modinfo.xml, and Linux filesystems are case-sensitive so an exact os.Stat would miss it.