ytwalk

package
v0.0.0-...-5019c65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ytwalk implements cypress traversal.

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipSubtree = errors.New("skip subtree")

ErrSkipSubtree is sentinel value returned from OnNode.

Functions

func Do

func Do(ctx context.Context, yc yt.Client, w *Walk) error

Types

type Walk

type Walk struct {
	// Root is cypress path where walk starts.
	Root ypath.Path

	// Attributes are requested for each node.
	Attributes []string

	// Node is optional pointer to type that will hold deserialized cypress node.
	Node interface{}

	// OnNode is invoked for each node during traversal.
	OnNode func(path ypath.Path, node interface{}) error

	// RespectOpaque defines whether we stop at opaque nodes (true) or not (false).
	RespectOpaque bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL