Documentation ¶
Overview ¶
Package writer implements the `whosonfirst/go-writer/v2` interfaces for writing documents to Elasticsearch.
Index ¶
- func NewElasticsearchV2Writer(ctx context.Context, uri string) (wof_writer.Writer, error)
- func NewElasticsearchV7Writer(ctx context.Context, uri string) (wof_writer.Writer, error)
- func NewElasticsearchV8Writer(ctx context.Context, uri string) (wof_writer.Writer, error)
- type ElasticsearchV2Writer
- func (wr *ElasticsearchV2Writer) Close(ctx context.Context) error
- func (wr *ElasticsearchV2Writer) Flush(ctx context.Context) error
- func (wr *ElasticsearchV2Writer) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *ElasticsearchV2Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
- func (wr *ElasticsearchV2Writer) WriterURI(ctx context.Context, uri string) string
- type ElasticsearchV7Writer
- func (wr *ElasticsearchV7Writer) Close(ctx context.Context) error
- func (wr *ElasticsearchV7Writer) Flush(ctx context.Context) error
- func (wr *ElasticsearchV7Writer) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *ElasticsearchV7Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
- func (wr *ElasticsearchV7Writer) WriterURI(ctx context.Context, uri string) string
- type ElasticsearchV8Writer
- func (wr *ElasticsearchV8Writer) Close(ctx context.Context) error
- func (wr *ElasticsearchV8Writer) Flush(ctx context.Context) error
- func (wr *ElasticsearchV8Writer) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *ElasticsearchV8Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
- func (wr *ElasticsearchV8Writer) WriterURI(ctx context.Context, uri string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewElasticsearchV7Writer ¶
NewElasticsearchV7Writer returns a new `ElasticsearchV7Writer` instance for writing documents to an Elasticsearch index using the github.com/elastic/go-elasticsearch/v7 package configured by 'uri' which is expected to take the form of:
elasticsearch://{HOST}:{PORT}/{INDEX}?{QUERY_PARAMETERS} elasticsearch7://{HOST}:{PORT}/{INDEX}?{QUERY_PARAMETERS}
Where {QUERY_PARAMETERS} may be one or more of the following: * ?debug={BOOLEAN}. If true then verbose Elasticsearch logging for requests and responses will be enabled. Default is false. * ?bulk-index={BOOLEAN}. If true then writes will be performed using a "bulk indexer". Default is true. * ?workers={INT}. The number of users to enable for bulk indexing. Default is 10.
func NewElasticsearchV8Writer ¶ added in v0.10.0
NewElasticsearchV8Writer returns a new `ElasticsearchV8Writer` instance for writing documents to an Elasticsearch index using the github.com/elastic/go-elasticsearch/v8 package configured by 'uri' which is expected to take the form of:
elasticsearch://{USER}:{PASSWORD}@{HOST}:{PORT}/{INDEX}?{QUERY_PARAMETERS} elasticsearch7://{USER}:{PASSWORD}@{HOST}:{PORT}/{INDEX}?{QUERY_PARAMETERS}
Where {QUERY_PARAMETERS} may be one or more of the following: * ?ca-cert-uri={STRING}. A valid gocloud.dev/runtimevar URI which, when dereferenced, will contain the Elasticsearch CA certificate to use for HTTPS requests. * ?es-password-uri={STRING}. An optional gocloud.dev/runtimevar URI which, when dereferenced, will contain the password for the {USER} account when making requests. If present, this value supersedes any password set in the "{USER}:{PATH}" component of 'uri'. * ?debug={BOOLEAN}. If true then verbose Elasticsearch logging for requests and responses will be enabled. Default is false. * ?bulk-index={BOOLEAN}. If true then writes will be performed using a "bulk indexer". Default is true. * ?workers={INT}. The number of users to enable for bulk indexing. Default is 10.
Types ¶
type ElasticsearchV2Writer ¶
type ElasticsearchV2Writer struct { wof_writer.Writer // contains filtered or unexported fields }
func (*ElasticsearchV2Writer) Close ¶
func (wr *ElasticsearchV2Writer) Close(ctx context.Context) error
func (*ElasticsearchV2Writer) Flush ¶
func (wr *ElasticsearchV2Writer) Flush(ctx context.Context) error
func (*ElasticsearchV2Writer) Write ¶
func (wr *ElasticsearchV2Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
type ElasticsearchV7Writer ¶
type ElasticsearchV7Writer struct { wof_writer.Writer // contains filtered or unexported fields }
ElasticsearchV7Writer is a struct that implements the `Writer` interface for writing documents to an Elasticsearch index using the github.com/elastic/go-elasticsearch/v7 package.
func (*ElasticsearchV7Writer) Close ¶
func (wr *ElasticsearchV7Writer) Close(ctx context.Context) error
Close waits for all pending writes to complete and closes the underlying writer mechanism.
func (*ElasticsearchV7Writer) Flush ¶
func (wr *ElasticsearchV7Writer) Flush(ctx context.Context) error
Flush() does nothing in a `ElasticsearchV7Writer` context.
func (*ElasticsearchV7Writer) Write ¶
func (wr *ElasticsearchV7Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
Write copies the content of 'fh' to the Elasticsearch index defined in `NewElasticsearchV7Writer`.
type ElasticsearchV8Writer ¶ added in v0.10.0
type ElasticsearchV8Writer struct { wof_writer.Writer // contains filtered or unexported fields }
ElasticsearchV8Writer is a struct that implements the `Writer` interface for writing documents to an Elasticsearch index using the github.com/elastic/go-elasticsearch/v8 package.
func (*ElasticsearchV8Writer) Close ¶ added in v0.10.0
func (wr *ElasticsearchV8Writer) Close(ctx context.Context) error
Close waits for all pending writes to complete and closes the underlying writer mechanism.
func (*ElasticsearchV8Writer) Flush ¶ added in v0.10.0
func (wr *ElasticsearchV8Writer) Flush(ctx context.Context) error
Flush() does nothing in a `ElasticsearchV8Writer` context.
func (*ElasticsearchV8Writer) Write ¶ added in v0.10.0
func (wr *ElasticsearchV8Writer) Write(ctx context.Context, path string, r io.ReadSeeker) (int64, error)
Write copies the content of 'fh' to the Elasticsearch index defined in `NewElasticsearchV8Writer`.