publisher

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: BSD-3-Clause Imports: 6 Imported by: 6

Documentation

Overview

Package publisher provides interfaces for (re)publishing documents that are emitted by an `Iterator` instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeaturePublisher

type FeaturePublisher struct {
	Publisher
	// AsJSON is a boolean flag signaling that the final output should be published as a JSON array.
	AsJSON bool
	// AsGeoJSON is a boolean flag signaling that the final output should be published as a GeoJSON FeatureCollection.
	AsGeoJSON bool
	// Writer is the underlying `io.Writer` instance where published data will be written to.
	Writer io.Writer
}

FeaturePublisher implements the Publisher interface for (re)publishing GeoJSON Feature documents that are emitted by an `Iterator` instance.

func (*FeaturePublisher) Publish

func (pub *FeaturePublisher) Publish(ctx context.Context, emitter_uri string, uris ...string) (int64, error)

Publish() will (re)publish all the documents emitted from an `Iterator` instance derived from 'emitter_uri' and 'uris'.

type Publisher

type Publisher interface {
	// Publish() publishes documents that are emitted by an `Iterator` instance. It takes as its arguments
	// a valid `emitter.Emitter` URI and a list of URIs to iterate through. It is assumed that implementations
	// of the Publisher interface will provide their own internal `emitter.EmitterCallbackFunc` callback
	// functions.
	Publish(context.Context, string, ...string) (int64, error)
}

type Publisher provides an interface for (re)publishing documents that are emitted by an `Iterator` instance.

Jump to

Keyboard shortcuts

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