Documentation ¶
Overview ¶
Keeps track of the versions of mods installed using SWkshp.
Each mod folder has its own ".swkshp.db" database
Index ¶
- Constants
- func CheckForUpdate(games ...string) (map[string]map[*resource.Resource]bool, []error)
- func DBCloseAll() (errs []error)
- func DBLen() int
- func DBOpen(game string) (*sql.DB, error)
- func GetDBPath(game string, create ...bool) (string, error)
- func RemoveModEntry(game string, id int) (sql.Result, error)
- func UpdateModEntry(game string, entry Entry) (sql.Result, error)
- type Entry
Constants ¶
View Source
const DBName string = ".swkshp.db"
Variables ¶
This section is empty.
Functions ¶
func CheckForUpdate ¶ added in v1.2.1
The map maps the game strings to a map mapping IDs to bools, where the boolean represents whether an update is available.
func DBCloseAll ¶ added in v1.2.0
func DBCloseAll() (errs []error)
func GetDBPath ¶
Gets the path to the sqlite3 database. If true is given as the second argument, it will create one if it doesn't exist.
func RemoveModEntry ¶
Deletes the mod database entry for a given game/mod id combination.
Types ¶
type Entry ¶
type Entry struct { ID int64 `db:"id"` // Workshop ID. Path string `db:"path"` // Relative path from game mod directory as given by config Sum []byte `db:"sum"` // 16 byte MD5 checksum. Updated time.Time `db:"updated"` // Timestamp of the last time it was changed. }
func Compare ¶
Returns the newest entry of the two and a boolean of whether or not the checksum is the same (true means it is)
func GetAllEntries ¶ added in v1.2.1
Gets all entries in the mods database for a given game.
func GetModEntry ¶
Gets the mod database entry for a given game/mod id combination.
Click to show internal directories.
Click to hide internal directories.