writers

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateWritersOptions

type CreateWritersOptions struct {
	// A registered `whosonfirst/go-writer/v3.Writer` URI describing where depiction data will be written to.
	DepictionWriterURI string
	// A registered `whosonfirst/go-writer/v3.Writer` URI describing where subject data will be written to.
	SubjectWriterURI string
	// An option `github.UpdateWriterURIOptions` struct used to append GitHub API / PR specific data to writers.
	GithubWriterOptions *github.UpdateWriterURIOptions
}

CreateWritersOptions is a struct containing configuration details for the `CreateWriters` method.

type Writers

type Writers struct {
	// A `whosonfirst/go-writer/v3.Writer` instance for writing depiction data to.
	DepictionWriter writer.Writer
	// A `whosonfirst/go-writer/v3.MultiWriter` instance wrapping both the principal `DepictionWriter` instance and an in-memory `writer.IOWriter` instance for writing depiction data to.
	DepictionMultiWriter writer.Writer
	// A `whosonfirst/go-writer/v3.Writer` instance for writing subject data to.
	SubjectWriter writer.Writer
	// A `whosonfirst/go-writer/v3.MultiWriter` instance wrapping both the principal `SubjectWriter` instance and an in-memory `writer.IOWriter` instance for writing subject data to.
	SubjectMultiWriter writer.Writer
	// contains filtered or unexported fields
}

Writers is a struct which encapsulates a pair of `whosonfirst/go-writer/v3.Writer` instances for writing data to depictions and subjects respectively. One is a simple Writer instance where data is expected to be persisted to. The second is a `writer.MultiWriter` instance which writes to both the default writer and a local in-memory `writer.IOWriter` instance. This allows the `Writers` struct to expose an `AsFeatureCollection` methods which can be invoked to return the update depiction and subject data (to the calling application) without having to query for that data from source. The reason that both the solitary writer and the multi writer are exposed is because there is often the need to write "alternate geometry" files is because the 'whosonfirst/go-whosonfirstwriter/v3.WriteBytes` function which is typically used to wrap writing data does not support alternate geometies. It should and eventually will but for the time being it doesn't.

func CreateWriters

func CreateWriters(ctx context.Context, opts *CreateWritersOptions) (*Writers, error)

CreateWriters will returns a new `Writers` instance derived from 'opts'.

func (*Writers) AsFeatureCollection

func (writers *Writers) AsFeatureCollection() (*geojson.FeatureCollection, error)

Jump to

Keyboard shortcuts

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