Go: add more commands and GCS supports (#16741)

### Summary

1. GCS supports
2. More commands
```
RAGFlow(admin)> ping store;
SUCCESS
RAGFlow(admin)> ping engine;
SUCCESS
RAGFlow(admin)> ping cache;
SUCCESS
```

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-08 17:49:02 +08:00
committed by GitHub
parent dc95b1d291
commit 21266286cb
26 changed files with 701 additions and 84 deletions

View File

@@ -19,6 +19,7 @@ package elasticsearch
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
@@ -59,6 +60,7 @@ func NewEngine(cfg interface{}) (*elasticsearchEngine, error) {
Transport: &http.Transport{
MaxIdleConnsPerHost: 10,
ResponseHeaderTimeout: 30 * time.Second,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
})
if err != nil {

View File

@@ -123,18 +123,18 @@ func (n *NatsEngine) ShowMessageQueue() (map[string]string, error) {
result["message_count"] = strconv.FormatUint(info.State.Msgs, 10)
consumer, err := n.stream.Consumer(ctx, "RAGFLOW_CONSUMER")
if err != nil {
return nil, fmt.Errorf("failed to get existing consumer: %w", err)
if err == nil {
var consumerInfo *jetstream.ConsumerInfo
consumerInfo, err = consumer.Info(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get consumer info: %w", err)
}
result["pending_count"] = strconv.FormatUint(consumerInfo.NumPending, 10)
result["waiting_count"] = strconv.Itoa(consumerInfo.NumWaiting)
result["ack_pending_count"] = strconv.Itoa(consumerInfo.NumAckPending)
result["redelivered_count"] = strconv.Itoa(consumerInfo.NumRedelivered)
}
consumerInfo, err := consumer.Info(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get consumer info: %w", err)
}
result["pending_count"] = strconv.FormatUint(consumerInfo.NumPending, 10)
result["waiting_count"] = strconv.Itoa(consumerInfo.NumWaiting)
result["ack_pending_count"] = strconv.Itoa(consumerInfo.NumAckPending)
result["redelivered_count"] = strconv.Itoa(consumerInfo.NumRedelivered)
return result, nil
}