Documentation
¶
Overview ¶
Package updatechain works out where a file stands against the updates that Nexus Mods knows about for its mod: whether something newer has replaced it, and whether that newer file has already been imported.
It only deals with the file ids and knows nothing about where the chain comes from (the Nexus cache) or what is done with the answer (showing it).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain is which file replaced which, for one mod. Its files can be of different kinds (main files, optional files, ...), each replaced by its own successors, but file ids are never shared so one Chain holds them all.
The zero Chain knows of no updates: every file is the latest.
func New ¶
New returns the Chain of the given updates. If several say what replaced the same file, the last one wins.
func (Chain) Closest ¶
Closest returns the index of the file of candidates that is closest to the latest file of its chain, that is, the one that has the fewest updates left. It is for the versions of one file that have been imported, where the one that matters is the most recent. The first of several that are equally close wins. ok is false when there are no candidates.
func (Chain) Distance ¶
Distance returns how many updates there are between fileID and the latest file of its chain: 0 for a file that nothing replaced.
func (Chain) HasSuccessor ¶
HasSuccessor reports whether some file replaced fileID.
type State ¶
type State int
State is where a file stands against the updates of its mod.
const ( // UpToDate means that nothing has replaced the file. UpToDate State = iota // Superseded means that the file has been replaced by a newer one that is // already imported, so there is nothing to tell the user about. Superseded // UpdateAvailable means that the file has been replaced by a newer one // that is not imported (yet). UpdateAvailable )