Documentation
¶
Index ¶
Constants ¶
const ( EnvArch = "GDENV_ARCH" EnvOS = "GDENV_OS" EnvPlatform = "GDENV_PLATFORM" )
Variables ¶
var ( ErrMissingArch = errors.New("missing architecture") ErrUnrecognizedArch = errors.New("unrecognized architecture") )
var ( ErrMissingOS = errors.New("missing OS") ErrUnrecognizedOS = errors.New("unrecognized OS") )
var ( ErrMissingPlatform = errors.New("missing platform") ErrUnrecognizedPlatform = errors.New("unrecognized platform") )
Functions ¶
func Format ¶
Formats a 'Platform' specification into a platform string found in Godot executable names.
NOTE: This method delegates to rather complex OS-specific methods. It would be great if there were a better way to organize this.
NOTE: This is a best effort implementation. Please open an issue on GitHub if some platform identifiers are missing or incorrect: github.com/coffeebeats/gdenv/issues/new?labels=bug&template=%F0%9F%90%9B-bug-report.md.
Types ¶
type Arch ¶
type Arch int
CPU architectures which the Godot project provides prebuilt editor binaries for.
func MustParseArch ¶
Parses an input string as a CPU architecture specification but panics if it would fail.
func ParseArch ¶
Parses an input string as a CPU architecture specification. Typically this will rely on the 'os.GOARCH' value, but users may override that setting via an environment variable. As such, this function recognizes some values in addition to what Go defines.
NOTE: This is a best effort implementation. Please open an issue on GitHub if some values are missing: github.com/coffeebeats/gdenv/issues/new?labels=bug&template=%F0%9F%90%9B-bug-report.md.
type OS ¶
type OS int
Operating systems which the Godot project provides prebuilt editor binaries for.
func MustParseOS ¶
Parses an input string as an operating system specification but panics if it would fail.
func ParseOS ¶
Parses an input string as an operating system specification. Typically this will rely on the 'GOOS' value, but users may override that setting via an environment variable. As such, this function recognizes some values in addition to what Go defines.
NOTE: This is a best effort implementation. Please open an issue on GitHub if some values are missing: github.com/coffeebeats/gdenv/issues/new?labels=bug&template=%F0%9F%90%9B-bug-report.md.
type Platform ¶
A platform specification representing a target to run the Godot editor on.
func Detect ¶
Resolves the target platform by first checking environment variables and then falling back to the host platform.