Add CI pipelines, fix linting issues (#12)

This commit is contained in:
T. von Dein
2026-05-07 15:01:18 +02:00
parent 5e82a3706b
commit 38ed9de0b4
14 changed files with 257 additions and 97 deletions

View File

@@ -28,12 +28,6 @@ import (
"github.com/elastic/go-elasticsearch/v9/typedapi/types/enums/healthstatus"
)
type Settings struct {
wait_for_active_shards string
number_of_shards int
number_of_replicas int
}
// used for completion
func IndexNames(conf *cfg.Config) ([]string, error) {
res, err := conf.DefaultCluster.ES.Cat.Indices().
@@ -42,7 +36,7 @@ func IndexNames(conf *cfg.Config) ([]string, error) {
Do(context.Background())
if err != nil {
return nil, fmt.Errorf("Error getting indicies: %s", err)
return nil, fmt.Errorf("failed to get indicies: %s", err)
}
indices := make([]string, len(res))
@@ -65,7 +59,7 @@ func IndexList(conf *cfg.Config) error {
res, err := cat.Do(context.Background())
if err != nil {
return fmt.Errorf("Error getting indicies: %s", err)
return fmt.Errorf("failed to get indicies: %s", err)
}
slog.Debug("ES result", "indicies", res)
@@ -92,7 +86,9 @@ func IndexList(conf *cfg.Config) error {
}
table.Sort()
table.PrintMarkdown()
if err := table.PrintMarkdown(); err != nil {
return err
}
return nil
}
@@ -131,7 +127,9 @@ func IndexShow(conf *cfg.Config, index string) error {
{"uuid", *res[index].Settings.Index.Uuid},
}
table.PrintMarkdown()
if err := table.PrintMarkdown(); err != nil {
return err
}
return nil
}