config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 4 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 config resolves runtime configuration for the Factorio MCP server from environment variables, with optional flag overrides handled by callers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host is the RCON host (default 127.0.0.1).
	Host string
	// Port is the RCON TCP port (default 27015).
	Port string
	// Password is the RCON password. Required.
	Password string
	// DialTimeout bounds the initial TCP connect + auth.
	DialTimeout time.Duration
	// RequestTimeout bounds a single command round-trip.
	RequestTimeout time.Duration
	// AllowEval enables the raw Lua eval escape hatch (a cheat / debug tool).
	AllowEval bool
}

Config holds everything needed to connect to a Factorio RCON endpoint.

func Load

func Load(args []string) (Config, error)

Load builds a Config from environment variables and the provided flag set. Flags, when set, override the environment. It returns an error if the password is missing, since the server cannot connect without it.

func (Config) Address

func (c Config) Address() string

Address returns the host:port string used to dial RCON.

Jump to

Keyboard shortcuts

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