entity_stream

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentMap

func CurrentMap(ctx context.Context, source BlueprintEntitySource, blueprintID string) (map[string]api.Entity, error)

CurrentMap builds the current target map for exactly one blueprint.

func ForEachEntity

func ForEachEntity(ctx context.Context, iter PageIterator, yield func(api.Entity) error) error

ForEachEntity calls yield for every entity from iter.

Types

type BlueprintEntitySource

type BlueprintEntitySource interface {
	ForEachEntity(ctx context.Context, blueprintID string, yield func([]api.Entity) error) error
}

BlueprintEntitySource returns entity pages for one blueprint at a time.

func FromAPI

FromAPI wraps any API client-like type that exposes ForEachEntity.

type BlueprintEntitySourceFunc

type BlueprintEntitySourceFunc func(ctx context.Context, blueprintID string, yield func([]api.Entity) error) error

BlueprintEntitySourceFunc adapts a function into a BlueprintEntitySource.

func (BlueprintEntitySourceFunc) ForEachEntity

func (f BlueprintEntitySourceFunc) ForEachEntity(ctx context.Context, blueprintID string, yield func([]api.Entity) error) error

type PageIterator

type PageIterator func(ctx context.Context, yield func([]api.Entity) error) error

PageIterator yields bounded pages of entities from any source.

func BlueprintIterator

func BlueprintIterator(source BlueprintEntitySource, blueprintID string) PageIterator

BlueprintIterator returns a page iterator scoped to one blueprint.

func EntityIterator

func EntityIterator(batchSize int, iter func(func(api.Entity) error) error) PageIterator

EntityIterator adapts an item callback source into a bounded page iterator.

func JSONLPageIterator

func JSONLPageIterator(path string, batchSize int) PageIterator

JSONLPageIterator reads newline-delimited JSON entities in bounded pages.

Jump to

Keyboard shortcuts

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