models

package
v4.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Properties map[string]interface{} `json:"properties"`
}

Doc is contained in the templateMapping

type Document

type Document struct {
	ID        string      `json:"id"`
	Index     string      `json:"index"`
	IndexType string      `json:"type"`
	Source    interface{} `json:"source"`
}

Document represent an es document

func NewDocument

func NewDocument(id string, index string, indexType string, source interface{}) *Document

NewDocument Construct a new Document

type Template

type Template struct {
	IndexPatterns []string               `json:"index_patterns"` // Keep the snake_case for elasticsearch template generation
	Settings      map[string]interface{} `json:"settings,omitempty"`
	Mappings      TemplateMapping        `json:"mappings,omitempty"`
}

Template is the ES template

func NewTemplate

func NewTemplate(indexPatterns []string, mapping map[string]interface{}, settings map[string]interface{}) *Template

NewTemplate constructor the ES template

type TemplateMapping

type TemplateMapping struct {
	Document Doc `json:"document"`
}

TemplateMapping embedded in template

Jump to

Keyboard shortcuts

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