entity

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToStringHookFunc

func AnyToStringHookFunc() mapstructure.DecodeHookFunc

func BucketsMapToSliceHookFunc

func BucketsMapToSliceHookFunc() mapstructure.DecodeHookFunc

func SettingItemHookFunc

func SettingItemHookFunc() mapstructure.DecodeHookFunc

Types

type Aggregations

type Aggregations map[string]*AggregationsResult

aggs

type AggregationsResult

type AggregationsResult struct {
	Buckets                 *[]*BucketItem
	DocCountErrorUpperBound int64                  `mapstructure:"doc_count_error_upper_bound,omitempty"`
	SumOtherDocCount        int64                  `mapstructure:"sum_other_doc_count,omitempty"`
	Other                   map[string]interface{} `mapstructure:",remain"`
}

type BucketItem

type BucketItem struct {
	Key       string       `mapstructure:"key"`
	DocCount  int64        `mapstructure:"doc_count"`
	RangeData RangeData    `mapstructure:",squash,omitempty"`
	Aggs      Aggregations `mapstructure:",remain"`
}

type DocumentBulkResult

type DocumentBulkResult struct {
	Took   int32                                 `json:"took"`
	Errors bool                                  `json:"errors"`
	Items  *[]map[string]*DocumentBulkResultItem `json:"items"`
}

type DocumentBulkResultItem

type DocumentBulkResultItem struct {
	DocumentIndexResult `mapstructure:",squash"`
	Status              uint32 `json:"status"`
	Error               *struct {
		ErrType   string `json:"status" mapstructure:"type"`
		Reason    string `json:"reason"`
		IndexUUid string `json:"uuid" mapstructure:"index_uuid"`
		Shard     string `json:"shard"`
		Index     string `json:"index"`
	} `json:"error,omitempty"`
}

type DocumentIndexResult

type DocumentIndexResult struct {
	Meta   `mapstructure:",squash"`
	Result string `json:"result"`
	Shards *struct {
		Total      uint32 `json:"total"`
		Successful uint32 `json:"successful"`
		Failed     uint32 `json:"failed"`
	} `json:"result" mapstructure:"_shards"`
	SeqNo       uint32 `json:"seq_no" mapstructure:"_seq_no"`
	PrimaryTerm uint32 `json:"primary_term" mapstructure:"_primary_term"`
}

type ErrorDetail

type ErrorDetail struct {
	RootCause *[]*struct {
		ErrType string `json:"type" mapstructure:"type"`
		Reason  string `json:"reason"`
	} `json:"root_cause" mapstructure:"root_cause"`
	ErrType string `json:"type" mapstructure:"type"`
	Reason  string `json:"reason"`
}

type EsAggregationRangeResult

type EsAggregationRangeResult struct {
	From       uint64
	To         uint64
	DocCount   uint32 `mapstructure:"doc_count"`
	TopDocHits struct {
		Hits *Hits
	} `mapstructure:"top_doc_hits,omitempty"`
}

type EsError

type EsError struct {
	Error  string `json:"error,omitempty"`
	Status int32  `json:"status,omitempty"`
}

type EsQueryResult

type EsQueryResult struct {
	EsError  `mapstructure:",squash"`
	Took     int32
	TimedOut bool `mapstructure:"timed_out"`
	Shards   *struct {
		Total      uint32
		Successful uint32
		Skipped    uint32
		Failed     uint32
	} `mapstructure:"_shards"`
	Hits *Hits
	Aggs Aggregations `mapstructure:"aggregations"`
}

type Hit

type Hit struct {
	Meta      `mapstructure:",squash"`
	Source    map[string]interface{}   `json:"_source,omitempty" mapstructure:"_source"`
	Sort      *[]interface{}           `json:"sort,omitempty"`
	InnerHits map[string]*InnerHitItem `json:"inner_hits,omitempty" mapstructure:"inner_hits"`
}

type Hits

type Hits struct {
	Total *struct {
		Value    int64  `json:"value"`
		Relation string `json:"relation"`
	} `json:"total"`
	MaxScore float32 `json:"max_score" mapstructure:"max_score"`
	Hits     *[]*Hit `json:"hits,omitempty" mapstructure:"hits"`
}

type IndexAlias

type IndexAlias struct {
	EsError `mapstructure:",squash"`
	Other   map[string]*IndexAliasItem `json:"result,omitempty" mapstructure:",remain"`
}

alias

func (*IndexAlias) GetIndexByAliasName

func (a *IndexAlias) GetIndexByAliasName(name string) []string

type IndexAliasItem

type IndexAliasItem struct {
	Aliases map[string]interface{} `json:"aliases,omitempty"`
}

type IndexInfo

type IndexInfo struct {
	Health       string `json:"health,omitempty"`
	Status       string `json:"status,omitempty"`
	Index        string `json:"index,omitempty"`
	UUid         string `json:"uuid,omitempty"`
	Pri          string `json:"pri,omitempty"`
	Rep          string `json:"rep,omitempty"`
	DocsCount    string `json:"docs.count,omitempty"`
	DocsDeleted  string `json:"docs.deleted,omitempty"`
	StoreSize    string `json:"store.size,omitempty"`
	PriStoreSize string `json:"pri.store.size,omitempty"`
}

cat indices

type IndexMapping

type IndexMapping struct {
	EsError `mapstructure:",squash"`
	Other   map[string]*MappingItem `json:"result" mapstructure:",remain"`
}

mapping

func (*IndexMapping) GetFields

func (mappings *IndexMapping) GetFields() map[string][]string

type IndexSetting

type IndexSetting struct {
	EsError `mapstructure:",squash"`
	Other   map[string]*SettingItem `json:"result" mapstructure:",remain"`
}

setting

func (*IndexSetting) GetSettings

func (s *IndexSetting) GetSettings(setting string) map[string]map[string]string

type InnerHitItem

type InnerHitItem struct {
	Hits *Hits `json:"hits,omitempty"`
}

type MappingItem

type MappingItem struct {
	Mappings *struct {
		Dynamic    bool                 `json:"dynamic"`
		Properties map[string]*Property `json:"properties,omitempty"`
	} `json:"mappings"`
}

type Meta

type Meta struct {
	Index   string  `json:"index,omitempty" mapstructure:"_index"`
	Type    string  `json:"type,omitempty" mapstructure:"_type"`
	Id      string  `json:"id,omitempty" mapstructure:"_id"`
	Score   float32 `json:"score,omitempty" mapstructure:"_score"`
	Version uint32  `json:"version,omitempty" mapstructure:"_version"`
	Nested  *Nested `json:"_nested,omitempty" mapstructure:"_nested"`
}

type MetricsAggTopHitsResultItem

type MetricsAggTopHitsResultItem struct {
	Hits *Hits
}

MetricsAggTopHits

type Nested

type Nested struct {
	Field  string `json:"field,omitempty"`
	Offset int    `json:"offset,omitempty"`
}

type OperateResult

type OperateResult struct {
	EsError            `mapstructure:",squash"`
	Acknowledged       bool   `json:"acknowledged,omitempty"`
	ShardsAcknowledged bool   `json:"shards_acknowledged,omitempty" mapstructure:"shards_acknowledged"`
	Index              string `json:"index,omitempty"`
}

type Property

type Property struct {
	Type       string               `json:"type,omitempty" `
	DocValues  bool                 `json:"doc_values,omitempty" mapstructure:"doc_values"`
	Properties map[string]*Property `json:"properties,omitempty"`
}

type RangeData added in v0.0.5

type RangeData struct {
	From float64
	To   float64
}

type Schema

type Schema struct {
	MappingItem
	SettingItem
}

type SettingItem

type SettingItem struct {
	Settings map[string]interface{} `json:"settings"`
}

Jump to

Keyboard shortcuts

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