versions

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Unlicense Imports: 11 Imported by: 0

Documentation

Overview

Keeps track of the versions of mods installed using SWkshp.

Each mod folder has its own ".swkshp.db" database

Index

Constants

View Source
const DBName string = ".swkshp.db"

Variables

This section is empty.

Functions

func CheckForUpdate added in v1.2.1

func CheckForUpdate(games ...string) (map[string]map[*resource.Resource]bool, []error)

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 DBLen added in v1.2.0

func DBLen() int

func DBOpen added in v1.2.0

func DBOpen(game string) (*sql.DB, error)

func GetDBPath

func GetDBPath(game string, create ...bool) (string, error)

func RemoveModEntry

func RemoveModEntry(game string, id int) (sql.Result, error)

func UpdateModEntry

func UpdateModEntry(game string, entry Entry) (sql.Result, error)

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

func Compare(a, b *Entry) (*Entry, bool)

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

func GetAllEntries(game string) ([]Entry, error)

func GetModEntry

func GetModEntry(game string, id int) (*Entry, error)

func NewModEntry

func NewModEntry(workshopID int, zippedModPath string) (Entry, error)

workshopID: The Steam Workshop ID of the mod.

zippedModPath: The local path to the mod as zipped by Steam.

Jump to

Keyboard shortcuts

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