All checks were successful
DCO action / DCO (pull_request) Successful in 59s
Tests and linters / Run gofumpt (pull_request) Successful in 1m9s
Vulncheck / Vulncheck (pull_request) Successful in 1m26s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m12s
Build / Build Components (pull_request) Successful in 2m21s
Tests and linters / Staticcheck (pull_request) Successful in 2m38s
Tests and linters / gopls check (pull_request) Successful in 2m41s
Tests and linters / Lint (pull_request) Successful in 3m25s
Tests and linters / Tests (pull_request) Successful in 4m17s
Tests and linters / Tests with -race (pull_request) Successful in 6m0s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
31 lines
622 B
Go
31 lines
622 B
Go
package common
|
|
|
|
import (
|
|
"github.com/davecgh/go-spew/spew"
|
|
"github.com/gdamore/tcell/v2"
|
|
"github.com/mr-tron/base58"
|
|
)
|
|
|
|
type RawEntry struct {
|
|
// key and value used for record dump.
|
|
// nolint:unused
|
|
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
|
|
}
|