common

package
v0.0.0-...-83a686f Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

common contains models that are common to ES operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conf config.ElasticsearchClient) (*elasticsearch.Client, error)

NewClient returns a configured elasticsearch.Client based on the given conf

Types

type DocumentID

type DocumentID string

type ElasticsearchErr

type ElasticsearchErr struct {
	Underlying error
}

func UnexpectedEsStatusError

func UnexpectedEsStatusError(rawResp *esapi.Response) ElasticsearchErr

func (ElasticsearchErr) Error

func (e ElasticsearchErr) Error() string

func (ElasticsearchErr) Unwrap

func (e ElasticsearchErr) Unwrap() error

type EsBulkResponse

type EsBulkResponse struct {
	Took   uint                 `json:"took"`
	Errors bool                 `json:"errors"`
	Items  []EsBulkResponseItem `json:"items"`
}

type EsBulkResponseItem

type EsBulkResponseItem struct {
	Index  *EsBulkResponseItemInfo `json:"index"`
	Delete *EsBulkResponseItemInfo `json:"delete"`
	Create *EsBulkResponseItemInfo `json:"create"`
	Update *EsBulkResponseItemInfo `json:"update"`
}

func (*EsBulkResponseItem) Info

type EsBulkResponseItemInfo

type EsBulkResponseItemInfo struct {
	Index       string `json:"_index"`
	ID          string `json:"_id"`
	SeqNum      uint64 `json:"_seq_no"`
	PrimaryTerm uint64 `json:"_primary_term"`
	Result      string `json:"result"`
	Status      uint   `json:"status"`
}

func (*EsBulkResponseItemInfo) IsOk

func (i *EsBulkResponseItemInfo) IsOk() bool

func (*EsBulkResponseItemInfo) Version

type EsCountResponse

type EsCountResponse struct {
	Count uint `json:"count"`
}

type EsCreateResponse

type EsCreateResponse struct {
	ID          string `json:"_id"`
	SeqNum      uint64 `json:"_seq_no"`
	PrimaryTerm uint64 `json:"_primary_term"`
}

func (*EsCreateResponse) Version

func (r *EsCreateResponse) Version() metadata.Version

type EsUpdateResponse

type EsUpdateResponse struct {
	Index       string `json:"_index"`
	ID          string `json:"_id"`
	SeqNum      uint64 `json:"_seq_no"`
	PrimaryTerm uint64 `json:"_primary_term"`
	Result      string `json:"result"`
}

func (*EsUpdateResponse) Version

func (r *EsUpdateResponse) Version() metadata.Version

type IndexName

type IndexName string

type JsonSerdesErr

type JsonSerdesErr struct {
	Underlying []error
}

func (JsonSerdesErr) Error

func (e JsonSerdesErr) Error() string

func (JsonSerdesErr) Unwrap

func (e JsonSerdesErr) Unwrap() error

type PersistedMetadata

type PersistedMetadata struct {
	CreatedAt  time.Time `json:"created_at"`
	ModifiedAt time.Time `json:"modified_at"`
}

Jump to

Keyboard shortcuts

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