engine, lang, lib: Re-order for consistency

Some small cleanups to make room for future patches.
This commit is contained in:
James Shubin
2023-12-01 14:44:00 -05:00
parent 984fb702e5
commit 7991b4ab25
5 changed files with 14 additions and 12 deletions

View File

@@ -45,13 +45,13 @@ type Engine struct {
Program string Program string
Version string Version string
Hostname string Hostname string
Converger *converger.Coordinator
World engine.World World engine.World
// Prefix is a unique directory prefix which can be used. It should be // Prefix is a unique directory prefix which can be used. It should be
// created if needed. // created if needed.
Prefix string Prefix string
Converger *converger.Coordinator
Debug bool Debug bool
Logf func(format string, v ...interface{}) Logf func(format string, v ...interface{})
@@ -223,9 +223,9 @@ func (obj *Engine) Commit() error {
Version: obj.Version, Version: obj.Version,
Hostname: obj.Hostname, Hostname: obj.Hostname,
//Converger: obj.Converger,
World: obj.World, World: obj.World,
Prefix: statePrefix, Prefix: statePrefix,
//Converger: obj.Converger,
Debug: obj.Debug, Debug: obj.Debug,
Logf: func(format string, v ...interface{}) { Logf: func(format string, v ...interface{}) {

View File

@@ -43,14 +43,15 @@ type State struct {
Program string Program string
Version string Version string
Hostname string Hostname string
//Converger *converger.Coordinator
World engine.World World engine.World
// Prefix is a unique directory prefix which can be used. It should be // Prefix is a unique directory prefix which can be used. It should be
// created if needed. // created if needed.
Prefix string Prefix string
//Converger *converger.Coordinator
// Debug turns on additional output and behaviours. // Debug turns on additional output and behaviours.
Debug bool Debug bool

View File

@@ -62,6 +62,7 @@ type Init struct {
// TODO: should we pass in a *Scope here for functions like template() ? // TODO: should we pass in a *Scope here for functions like template() ?
World engine.World World engine.World
Debug bool Debug bool
Logf func(format string, v ...interface{}) Logf func(format string, v ...interface{})
} }

View File

@@ -2001,9 +2001,9 @@ func TestAstFunc3(t *testing.T) {
Program: "testing", // TODO: name it mgmt? Program: "testing", // TODO: name it mgmt?
//Version: obj.Version, //Version: obj.Version,
Hostname: "localhost", Hostname: "localhost",
Converger: converger,
World: world, World: world,
Prefix: fmt.Sprintf("%s/", filepath.Join(tmpdir, "engine")), Prefix: fmt.Sprintf("%s/", filepath.Join(tmpdir, "engine")),
Converger: converger,
Debug: testing.Verbose(), Debug: testing.Verbose(),
Logf: func(format string, v ...interface{}) { Logf: func(format string, v ...interface{}) {
logf("engine: "+format, v...) logf("engine: "+format, v...)

View File

@@ -492,9 +492,9 @@ func (obj *Main) Run() error {
Program: obj.Program, Program: obj.Program,
Version: obj.Version, Version: obj.Version,
Hostname: hostname, Hostname: hostname,
Converger: converger,
World: world, World: world,
Prefix: fmt.Sprintf("%s/", path.Join(prefix, "engine")), Prefix: fmt.Sprintf("%s/", path.Join(prefix, "engine")),
Converger: converger,
//Prometheus: prom, // TODO: implement this via a general Status API //Prometheus: prom, // TODO: implement this via a general Status API
Debug: obj.Flags.Debug, Debug: obj.Flags.Debug,
Logf: func(format string, v ...interface{}) { Logf: func(format string, v ...interface{}) {