2024-07-18 15:26:11 +00:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/davecgh/go-spew/spew"
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
|
|
"github.com/mr-tron/base58"
|
|
|
|
)
|
|
|
|
|
|
|
|
type RawEntry struct {
|
2024-09-24 12:58:52 +00:00
|
|
|
// key and value used for record dump.
|
|
|
|
// nolint:unused
|
2024-07-18 15:26:11 +00:00
|
|
|
key, value []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
var RawParser Parser = rawParser
|
|
|
|
|
|
|
|
func rawParser(key, value []byte) (SchemaEntry, Parser, error) {
|
|
|
|
return &RawEntry{key: key, value: value}, rawParser, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *RawEntry) String() string {
|
|
|
|
return FormatSimple(base58.Encode(r.key), tcell.ColorRed)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *RawEntry) DetailedString() string {
|
|
|
|
return spew.Sdump(r)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *RawEntry) Filter(string, any) FilterResult {
|
|
|
|
return No
|
|
|
|
}
|