settings

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package settings reads and writes the file-backed settings a server declares in its profile. Edits are surgical: only the value of the declared key changes, and every other byte of the file, including comments, alignment and line endings, is left as it was.

Index

Constants

This section is empty.

Variables

View Source
var ErrFileMissing = errors.New("settings file not installed")

ErrFileMissing means the setting's file doesn't exist yet. The launcher never creates it: a missing file usually means its component hasn't been installed, and creating one could stop a "once" file ever arriving.

Functions

func Read

func Read(dir string, s spec.Setting) (interface{}, error)

Read returns a file setting's current value in its typed form: bool, int or string. A key the file doesn't carry reports the setting's default.

func SetINIKeys

func SetINIKeys(dir, rel, section string, values map[string]string) error

SetINIKeys sets several keys in one section of an existing ini file, with the same surgical edits as Write. It is for launcher features such as d2gl box profiles, not for settings a server declares.

func Write

func Write(dir string, s spec.Setting, value interface{}) error

Write sets a file setting to value, which must match the setting's type.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL