Documentation
¶
Overview ¶
Package steamfolder is a library to work with a local Steam installation.
It provides types and functions to locate Steam, parse its library and library folders, list and find apps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrSteamNotFound = errors.New("Steam not found") ErrInvalidSteamInstallDir = errors.New("Steam install path exists but is not a directory") )
Functions ¶
This section is empty.
Types ¶
type AppManifest ¶
type AppManifest struct {
// ID
AppID steamlib.AppID
// Name
Name string
// Install dir
InstallDir string
// Absolute install dir
AbsInstallDir string
// Size (in bytes)
Size uint64
}
AppManifest represents a parsed `appmanifest_*.acf` file inside a library folder.
func NewAppManifest ¶
func NewAppManifest(folder *LibraryFolder, appID steamlib.AppID) (*AppManifest, error)
NewAppManifest parses an AppManifest in a given `folder` for the given `appID`.
func ParseAppManifest ¶
func ParseAppManifest(path string) (*AppManifest, error)
ParseAppManifest parses an app manifest at the given `path`.
type Library ¶
type Library struct {
// List of library folders
Folders []*LibraryFolder
// contains filtered or unexported fields
}
Library represents a parsed `libraryfolders.vdf` file.
func NewLibrary ¶
NewLibrary parses a Library found in a given `steamDir` directory.
func ParseLibrary ¶
ParseLibrary parses a `libraryfolders.vdf` file at the given `path`.
func (*Library) FindApp ¶
func (l *Library) FindApp(appID steamlib.AppID) (*LibraryFolder, *AppManifest, error)
FindApp finds and parses the app manifest for the given `appID`, returning the folder in which the app was found and the parsed manifest.
It returns `(nil, nil, nil)` if the given `appID` was not found.
type LibraryFolder ¶
type LibraryFolder struct {
// Absolute path
Path string
// Label
Label string
// Total size (in bytes)
TotalSize uint64
// List of app IDs (sorted)
Apps []steamlib.AppID
}
LibraryFolder represents a library folder entry in a `libraryfolders.vdf` file.
func (*LibraryFolder) ContainsApp ¶
func (f *LibraryFolder) ContainsApp(appID steamlib.AppID) bool
ContainsApp returns true if this LibraryFolder contains the given `appID`.
func (*LibraryFolder) ParseAppManifest ¶
func (f *LibraryFolder) ParseAppManifest(appID steamlib.AppID) (*AppManifest, error)
ParseAppManifest parses the AppManifest for the given `appID`.
type Steam ¶
type Steam struct {
// Install directory
Path string
}
Steam represents a Steam installation.
func FindSteam ¶
FindSteam tries to find an Steam installation directory.
It returns error `ErrSteamNotFound` if it did not find a suitable directory.