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 ¶
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 ¶
func FromAPI(client BlueprintEntitySource) BlueprintEntitySource
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 ¶
type PageIterator ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.