Documentation
¶
Overview ¶
Package fetch downloads server files: plain archives over HTTPS, and Steam apps through SteamCMD.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Download fetches url into the cache directory and returns the file path. If want (a sha256 hex string) is set, the file must match it, and a cached file that already matches is reused without downloading.
func Extract ¶
Extract unpacks the part of an archive under subdir into dest. Paths in the archive that would land outside dest are rejected. Existing files are replaced, and files not in the archive are left alone, so saves survive.
func ExtractAs ¶
ExtractAs is Extract for an archive whose type is given as format (zip, tar.gz or tar.xz) instead of read from its file name. An empty format means use the file name. Files listed in keep (paths relative to dest) aren't replaced if they already exist, so config files the archive ships with don't overwrite the user's.
Types ¶
type App ¶
type App struct {
ID int
Dir string
// Platform optionally forces another OS's build (linux, windows, macos).
Platform string
// Beta is an optional beta branch.
Beta string
// User logs in with a cached Steam session instead of anonymously.
User string
}
App describes one SteamCMD app install.
type SteamCMD ¶
type SteamCMD struct {
Dir string
Cache string
Log Progress
// Output receives SteamCMD's own output. Nil discards it.
Output io.Writer
}
SteamCMD manages a private copy of SteamCMD.