Documentation
¶
Overview ¶
Package factorio turns typed calls into one-line RCON commands routed through the factorio_mcp companion mod, and decodes the mod's JSON envelope back into Go values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeLuaSingleQuoted ¶
EscapeLuaSingleQuoted escapes s so it can be safely embedded inside a Lua single-quoted string literal. Payloads are always passed inside '...' in the command templates, so only a small, well-defined set of bytes is dangerous: the escape character itself and the closing quote. Control characters are escaped defensively even though JSON-encoded payloads never contain raw ones.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the default Dispatcher, backed by an RCON executor.
type Dispatcher ¶
type Dispatcher interface {
Call(ctx context.Context, fn string, args any) (json.RawMessage, error)
Eval(ctx context.Context, lua string) (json.RawMessage, error)
}
Dispatcher executes named companion-mod functions and evaluates raw Lua.