go-scopes/tests/etc/etc_mx.go

38 lines
828 B
Go

package etc
import (
lib "git.sr.ht/~cco/go-scopes"
"git.sr.ht/~cco/go-scopes/app"
"git.sr.ht/~cco/go-scopes/common/testing"
"git.sr.ht/~cco/go-scopes/config"
"git.sr.ht/~cco/go-scopes/core/action"
"git.sr.ht/~cco/go-scopes/logging"
"git.sr.ht/~cco/go-scopes/matrix"
)
func ConfigMx() lib.Config {
b := config.Base
app_c := &app.Cfg{
BaseCfg: b("matrix", testing.Start),
Logging: &logging.Cfg{
Logfile: "log/matrix.log",
Level: "debug",
},
}
app_c.AddAction("demo", action.Base(action.Forward, "test-receiver"))
test_rcvr := config.Default("test-receiver")
test_rcvr.AddAction("demo", action.Base(AH_MxReceiver))
cell_0 := matrix.DefaultConfig("cell-0")
app_c.Add(cell_0, test_rcvr)
return app_c
}
// register action handlers from ..._test.go here.
var (
AH_MxReceiver lib.ActionHandler
)