elasticsearch

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Ping executes Elasticsearch ping request.
	// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
	Ping(ctx context.Context) error

	// Bulk executes Elasticsearch Bulk API request.
	// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
	Bulk(ctx context.Context, reader io.Reader) (io.ReadCloser, error)

	// PrepareCreateOperation prepares insert operation definition for Bulk API query.
	PrepareCreateOperation(item sdk.Record) (metadata interface{}, payload interface{}, err error)

	// PrepareUpsertOperation prepares upsert operation definition for Bulk API query.
	PrepareUpsertOperation(key string, item sdk.Record) (metadata interface{}, payload interface{}, err error)

	// PrepareDeleteOperation prepares delete operation definition for Bulk API query.
	PrepareDeleteOperation(key string) (metadata interface{}, err error)
}

Client describes Elasticsearch client interface

func NewClient

func NewClient(version Version, config interface{}) (Client, error)

NewClient creates new Elasticsearch client which supports given server version. Returns error when provided version is unsupported or client initialization failed.

type Version

type Version = string
const (
	Version5 Version = "5"
	Version6 Version = "6"
	Version7 Version = "7"
	Version8 Version = "8"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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