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

View File

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

View File

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

View File

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

View File

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