mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 13:44:17 +02:00
Add CI pipelines, fix linting issues (#12)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user