Documentation
¶
Overview ¶
Package project defines the luanti.toml project manifest format.
Index ¶
- Constants
- Variables
- func AddPackage(p *Project, id, pkgType string) bool
- func Save(p *Project, path string) error
- func SetModEnabled(worldDir, modName string, enabled bool) error
- func SyncConfig(confPath string, config map[string]any) error
- type BackupConfig
- type PackageEntry
- type PackagesConfig
- type PathsConfig
- type Project
- type ServerConfig
- type WorldConfig
Constants ¶
const Filename = "luanti.toml"
Filename is the standard project manifest file name.
Variables ¶
var ErrNotFound = errors.New("no luanti.toml found in current directory — run: luctl project init")
ErrNotFound is returned when no luanti.toml exists in the current directory.
Functions ¶
func AddPackage ¶
AddPackage appends a package to the appropriate list if not already declared. Returns true if the entry was added, false if a duplicate was found.
func Save ¶
Save writes the project to path as TOML. Mods and games lists are each sorted alphabetically before writing. String arrays with more than one element are written one item per line.
func SetModEnabled ¶
SetModEnabled writes load_mod_<modName> = <enabled> into world.mt, updating an existing line in-place or appending if no entry exists yet.
Types ¶
type BackupConfig ¶ added in v0.3.0
type BackupConfig struct {
Bucket string `toml:"bucket"`
Endpoint string `toml:"endpoint"`
Region string `toml:"region"`
Prefix string `toml:"prefix"`
}
BackupConfig holds S3-compatible storage settings for server backups. Credentials are NOT stored here — set LUCTL_S3_ACCESS_KEY and LUCTL_S3_SECRET_KEY env vars.
type PackageEntry ¶
PackageEntry is a resolved (id, type) pair produced by AllEntries.
type PackagesConfig ¶
PackagesConfig holds the declared package dependencies, split by type. IDs use ContentDB "author/name" format.
func (*PackagesConfig) AllEntries ¶
func (pc *PackagesConfig) AllEntries() []PackageEntry
AllEntries returns every declared package as (id, type) pairs, convenient for iteration in install/status commands.
type PathsConfig ¶
type PathsConfig struct {
ModsDir string `toml:"mods_dir"`
GamesDir string `toml:"games_dir"`
WorldDir string `toml:"world_dir"`
ConfFile string `toml:"conf_file"`
}
PathsConfig holds filesystem paths used by luctl commands.
type Project ¶
type Project struct {
Server ServerConfig `toml:"server"`
World WorldConfig `toml:"world"`
Paths PathsConfig `toml:"paths"`
Packages PackagesConfig `toml:"packages"`
Config map[string]any `toml:"config"`
Backup BackupConfig `toml:"backup"`
}
Project is the top-level structure of a luanti.toml manifest.
func LoadCurrent ¶
LoadCurrent loads luanti.toml from the current working directory.
type ServerConfig ¶
type ServerConfig struct {
Name string `toml:"name"`
Description string `toml:"description"`
Port int `toml:"port"`
Admins []string `toml:"admins"`
}
ServerConfig holds server identity and network settings.
type WorldConfig ¶
WorldConfig holds world generation settings.