elasticsearch

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorUnexpectedStatusCode = errors.New("unexpected status code from api")

ErrorUnexpectedStatusCode represents the error message to be returned when the status received from elastic is not as expected

Functions

func GetMappingsJSON added in v1.12.0

func GetMappingsJSON() []byte

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API aggregates a client and URL and other common data for accessing the API

func NewElasticSearchAPI

func NewElasticSearchAPI(clienter http.Clienter, elasticSearchClient *elasticsearch.Client) *API

NewElasticSearchAPI creates an ElasticSearchAPI object

func (*API) AddDimensionOption

func (api *API) AddDimensionOption(ctx context.Context, instanceID, dimension string, dimensionOption models.DimensionOption) (int, error)

AddDimensionOption adds a document to an elastic search index

func (*API) CreateSearchIndex

func (api *API) CreateSearchIndex(ctx context.Context, instanceID, dimension string) (int, error)

CreateSearchIndex creates a new index in elastic search

func (*API) DeleteSearchIndex

func (api *API) DeleteSearchIndex(ctx context.Context, instanceID, dimension string) (int, error)

DeleteSearchIndex removes an index from elastic search

type APIer

type APIer interface {
	CreateSearchIndex(ctx context.Context, instanceID, dimension string) (int, error)
	DeleteSearchIndex(ctx context.Context, instanceID, dimension string) (int, error)
	AddDimensionOption(ctx context.Context, instanceID, dimension string, dimensionOption models.DimensionOption) (int, error)
}

APIer - An interface used to access the ElasticAPI

Jump to

Keyboard shortcuts

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