eshelper

package
v0.0.1-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMapping

func GetMapping(bin []byte) (mapping.TypeMapping, error)

Types

type FetchDocResult

type FetchDocResult struct {
	ResponseBase
	Found   bool            `json:"found"`
	Source_ json.RawMessage `json:"_source"`
}

type Helper

type Helper struct {
	Client *elasticsearch.Client
}

func (*Helper) CreateRandomIndex

func (h *Helper) CreateRandomIndex(settingsJson []byte) (*IndexHelper, error)

func (*Helper) IsHealthy

func (h *Helper) IsHealthy(ctx context.Context) (bool, error)

type IndexHelper

type IndexHelper struct {
	*Helper
	IndexName string
}

func (*IndexHelper) Delete

func (h *IndexHelper) Delete() error

Delete deletes the index pointed by h.

func (*IndexHelper) GetDoc

func (h *IndexHelper) GetDoc(id string, v any) error

func (*IndexHelper) PostDoc

func (h *IndexHelper) PostDoc(doc any) (docId string, err error)

type IndexResult

type IndexResult struct {
	ResponseBase
	Result  string `json:"result"`
	Shards_ Shards `json:"_shards"`
}

type ResponseBase

type ResponseBase struct {
	Index_       string `json:"_index"`
	Id_          string `json:"_id"`
	Version_     int    `json:"_version"`
	SeqNo_       int    `json:"_seq_no"`
	PrimaryTerm_ int    `json:"_primary_term"`
}

type Shards

type Shards struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

Jump to

Keyboard shortcuts

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