add support for config file and multiple clusters config (#1)

This commit is contained in:
T. von Dein
2026-04-27 09:11:10 +02:00
parent 496f4aeda3
commit 17f92874e5
7 changed files with 154 additions and 37 deletions

View File

@@ -26,7 +26,7 @@ import (
)
func IndexList(conf *cfg.Config) error {
cat := conf.ES.Cat.Indices()
cat := conf.DefaultCluster.ES.Cat.Indices()
if conf.Failed {
cat = cat.Health(healthstatus.Red)
@@ -67,7 +67,7 @@ func IndexList(conf *cfg.Config) error {
}
func IndexShow(conf *cfg.Config, index string) error {
res, err := conf.ES.Indices.Get(index).Do(context.Background())
res, err := conf.DefaultCluster.ES.Indices.Get(index).Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get index: %s", err)
}