enhanced default cluster selection, add 'cluster switch', overhaul json header setting (#47)

This commit is contained in:
T. von Dein
2026-06-24 09:25:50 +02:00
parent 3c6819151f
commit ffcb8adb70
26 changed files with 393 additions and 320 deletions

View File

@@ -28,9 +28,7 @@ import (
)
func TaskList(conf *cfg.Config) error {
res, err := conf.DefaultCluster.ES.Cat.Tasks().
Header("content-type", "application/json").
Header("accept", "application/json").
res, err := conf.DefaultCluster.ES().Cat.Tasks().
Do(context.Background())
if err != nil {
@@ -65,10 +63,8 @@ func TaskList(conf *cfg.Config) error {
}
func TaskCancel(conf *cfg.Config, taskid string) error {
_, err := conf.DefaultCluster.ES.Tasks.Cancel().
_, err := conf.DefaultCluster.ES().Tasks.Cancel().
TaskId(taskid).
Header("content-type", "application/json").
Header("accept", "application/json").
Do(context.Background())
if err != nil {