Documentation
¶
Overview ¶
Package factorio provides tooling to interact with Factorio files & binary.
Index ¶
- Constants
- func EnableMod(modsPath string, modName string) error
- func Encode(data []byte) string
- type Factorio
- func (f *Factorio) Binary() string
- func (f *Factorio) CopyMods(dstMods string, filterOut []string) error
- func (f *Factorio) DataDir() string
- func (f *Factorio) FindSaveFile(name string) (string, error)
- func (f *Factorio) ForceVerbose()
- func (f *Factorio) ModsDir() string
- func (f *Factorio) Run(ctx context.Context, args []string) error
- func (f *Factorio) ScriptOutput() string
- type ModList
- type ModListEntry
- type Settings
Constants ¶
const ( // ModsDir is the datadir subdir for mods. ModsDir = "mods" // SavesDir is the datadir subdirectory for game saves. SavesDir = "saves" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factorio ¶
type Factorio struct {
// contains filtered or unexported fields
}
Factorio offers methods to manipulate a Factorio install.
func (*Factorio) CopyMods ¶
CopyMods creates a mods directory in the given location based on the current one. This can serve as a base to forcefully enable a mod or similar.
func (*Factorio) FindSaveFile ¶
FindSaveFile try to find the savegame with the given name. It will look in current directory, in Factorio directory, with and without .zip.
func (*Factorio) ScriptOutput ¶
ScriptOutput is the place where mods can write data.
type ModList ¶
type ModList struct {
Mods []*ModListEntry `json:"mods"`
}
ModList represents the content of `mod-list.json` file in Factorio.
func LoadModList ¶
LoadModList reads a mod-list.json file from its filename.
type ModListEntry ¶
ModListEntry is a single mod entry in the `mod-list.json` file.
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings for creating a Factorio helper instance.
func (*Settings) DataDir ¶
DataDir returns the place where saves, mods and others are located. Returns "" if no directory is found.
func (*Settings) ScriptOutput ¶
ScriptOutput returns the Factorio script-output directory.