document

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Overview

Package document provides methods for updating a single Who's On First document for indexing in Elasticsearch.

Note: One of the things you'll see in the code that makes up the `document` package is stuff like this:

for k, v := range to_assign {

	path := k

	if props_rsp.Exists() {
		path = fmt.Sprintf("properties.%s", k)
	}

	body, err = sjson.SetBytes(body, path, v)
	...
}

This is code to account for the fact that a record may be a "spelunker v1" document in which case it will be a simple hash map, equivalent to a GeoJSON properties dictionary, rather than a complete GeoJSON document.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSpelunkerV1Properties

func AppendSpelunkerV1Properties(ctx context.Context, body []byte) ([]byte, error)

AppendSpelunkerV1Properties appends properties specific to the v1" Elasticsearch (v2.x) schema to a Who's On First document for. For details please consult: https://github.com/whosonfirst/es-whosonfirst-schema/tree/master/schema/2.4

func PrepareSpelunkerV1Document

func PrepareSpelunkerV1Document(ctx context.Context, body []byte) ([]byte, error)

PrepareSpelunkerV1Document prepares a Who's On First document for indexing with the "v1" Elasticsearch (v2.x) schema. For details please consult: https://github.com/whosonfirst/es-whosonfirst-schema/tree/master/schema/2.4

Types

type PrepareDocumentFunc

type PrepareDocumentFunc func(context.Context, []byte) ([]byte, error)

type PrepareDocumentFunc is a common method signature updating a Who's On First document for indexing in Elasticsearch.

Jump to

Keyboard shortcuts

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