Commit 45e57ad5 authored by Eric Myhre's avatar Eric Myhre

fluent.Node was missing a Kind accessor.

Signed-off-by: default avatarEric Myhre <hash@exultant.us>
parent 919e159c
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment