Key and answer a ledger index by mesh-sdk's IndexKey and IndexEntry, the one shape the owner's watcher also writes (issue 1966 T3)

This commit is contained in:
2026-11-03 15:15:00 +01:00
parent d206b0dde1
commit fadc73f73b
5 changed files with 40 additions and 44 deletions
+3 -4
View File
@@ -10,7 +10,6 @@ import (
"strings"
"time"
"git.novox.be/novox/mesh-sdk/go/buscalls"
"git.novox.be/novox/mesh-sdk/go/membership"
"github.com/nats-io/nats.go"
"github.com/nats-io/nats.go/jetstream"
@@ -290,7 +289,7 @@ func (c *Conn) LedgerIndexes(b membership.BusBinding) map[string]ledger.Index {
return out
}
func (s *busState) Entries(pattern string, limit int) ([]buscalls.IndexEntry, error) {
func (s *busState) Entries(pattern string, limit int) ([]ledger.Indexed, error) {
if pattern == "" {
pattern = ">"
}
@@ -299,7 +298,7 @@ func (s *busState) Entries(pattern string, limit int) ([]buscalls.IndexEntry, er
return nil, err
}
sort.Strings(keys)
var out []buscalls.IndexEntry
var out []ledger.Indexed
for _, k := range keys {
if limit > 0 && len(out) >= limit {
break
@@ -312,7 +311,7 @@ func (s *busState) Entries(pattern string, limit int) ([]buscalls.IndexEntry, er
return out, err
}
if v != nil {
out = append(out, buscalls.IndexEntry{Key: k, Value: valueOf(v)})
out = append(out, ledger.Indexed{Key: k, Value: v})
}
}
return out, nil