versions

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Unlicense Imports: 9 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 CreateDBFromGame

func CreateDBFromGame(game string) error

func CreateDBFromPath

func CreateDBFromPath(path string) 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 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