fluent.Node was missing a Kind accessor.
@@ -15,6 +15,7 @@ import (
// Any of the terminal scalar-returning methods will panic if an error is stored.
// (The fluent.Recover function can be used to nicely gather these panics.)
type Node interface {
+ Kind() ipld.ReprKind
TraverseField(path string) Node
TraverseIndex(idx int) Node
IsNull() bool
@@ -47,6 +48,12 @@ func (e Error) Error() string {
func (n node) GetError() error {
return n.err
}
+func (n node) Kind() ipld.ReprKind {
+ if n.err != nil {
+ panic(Error{n.err})
+ }
+ return n.n.Kind()
+}
func (n node) TraverseField(path string) Node {
if n.err != nil {
return n
