add yanductor backend support and update config options

This commit is contained in:
Dmitrii Andreev
2024-11-17 23:57:02 +03:00
parent 208e6c9227
commit dd67863677
2 changed files with 20 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/viert/xc/backend/conductor"
"github.com/viert/xc/backend/inventoree"
"github.com/viert/xc/backend/localini"
"github.com/viert/xc/backend/yanductor"
_ "net/http/pprof"
@@ -64,6 +65,19 @@ func main() {
return
}
tool, err = cli.New(xccfg, be)
if err != nil {
term.Errorf("%s\n", err)
return
}
case config.BTYanductor:
be, err := yanductor.New(xccfg)
if err != nil {
term.Errorf("Error creating conductor backend: %s\n", err)
return
}
tool, err = cli.New(xccfg, be)
if err != nil {
term.Errorf("%s\n", err)

View File

@@ -12,13 +12,13 @@ import (
)
const defaultConfigContents = `[main]
user =
user =
mode = parallel
history_file = ~/.xc_history
cache_dir = ~/.xc_cache
cache_ttl = 336 # 24 * 7 * 2
rc_file = ~/.xcrc
log_file =
log_file =
raise = none
exit_confirm = true
exec_confirm = true
@@ -51,7 +51,7 @@ ServerAliveInterval = 5
[backend]
type = conductor
url = http://c.inventoree.ru
work_groups =
work_groups =
[passmgr]
path =
@@ -64,6 +64,7 @@ type BackendType int
const (
BTIni BackendType = iota
BTConductor
BTYanductor
BTInventoree
)
@@ -358,6 +359,8 @@ func read(filename string, secondPass bool) (*XCConfig, error) {
cfg.BackendCfg.Type = BTIni
case "conductor":
cfg.BackendCfg.Type = BTConductor
case "yanductor":
cfg.BackendCfg.Type = BTYanductor
case "inventoree":
cfg.BackendCfg.Type = BTInventoree
default: