Documentation ¶
Index ¶
- func AllP(v types.Value, vr types.ValueReader, cb AllCallback, concurrency int)
- func SomeChunksP(r types.Ref, bs types.BatchStore, stopCb SomeChunksStopCallback, ...)
- func SomeP(v types.Value, vr types.ValueReader, cb SomeCallback, concurrency int)
- type AllCallback
- type SomeCallback
- type SomeChunksChunkCallback
- type SomeChunksStopCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllP ¶
func AllP(v types.Value, vr types.ValueReader, cb AllCallback, concurrency int)
AllP recursively walks over all types.Values reachable from r and calls cb on them. If |concurrency| > 1, it is the callers responsibility to make ensure that |cb| is threadsafe.
func SomeChunksP ¶
func SomeChunksP(r types.Ref, bs types.BatchStore, stopCb SomeChunksStopCallback, chunkCb SomeChunksChunkCallback, concurrency int)
SomeChunksP invokes callbacks on every unique chunk reachable from |r| in top-down order. Callbacks are invoked only once for each chunk regardless of how many times the chunk appears.
|stopCb| is invoked for the types.Ref of every chunk. It can return true to stop SomeChunksP from descending any further. |chunkCb| is optional, invoked with the chunks.Chunk referenced by |stopCb| if it didn't return true.
func SomeP ¶
func SomeP(v types.Value, vr types.ValueReader, cb SomeCallback, concurrency int)
SomeP recursively walks over all types.Values reachable from r and calls cb on them. If cb ever returns true, the walk will stop recursing on the current ref. If |concurrency| > 1, it is the callers responsibility to make ensure that |cb| is threadsafe.
Types ¶
type AllCallback ¶
AllCallback takes a types.Value and processes it. If |v| is a top-level value in a Chunk, then |r| will be the Ref which referenced it (otherwise |r| is nil).
type SomeCallback ¶
SomeCallback takes a types.Value and returns a bool indicating whether the current walk should skip the tree descending from value. If |v| is a top-level value in a Chunk, then |r| will be the Ref which referenced it (otherwise |r| is nil).
type SomeChunksChunkCallback ¶
SomeChunksChunkCallback is called for every unique chunks.Chunk |c| which wasn't stopped from SomeChunksStopCallback. |r| is a types.Ref referring to |c|.
type SomeChunksStopCallback ¶
SomeChunksStopCallback is called for every unique types.Ref |r|. Return true to stop walking beyond |r|.