 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig for index template DefaultConfig = TemplateConfig{ Enabled: true, Fields: "fields.yml", } )
Functions ¶
This section is empty.
Types ¶
type ESClient ¶
type ESClient interface {
	LoadJSON(path string, json map[string]interface{}) ([]byte, error)
	Request(method, path string, pipeline string, params map[string]string, body interface{}) (int, []byte, error)
	GetVersion() string
}
    TemplateLoader is a subset of the Elasticsearch client API capable of loading the template.
type Field ¶
type Field struct {
	Name           string `config:"name"`
	Type           string `config:"type"`
	Description    string `config:"description"`
	Format         string `config:"format"`
	ScalingFactor  int    `config:"scaling_factor"`
	Fields         Fields `config:"fields"`
	MultiFields    Fields `config:"multi_fields"`
	ObjectType     string `config:"object_type"`
	Enabled        *bool  `config:"enabled"`
	Analyzer       string `config:"analyzer"`
	SearchAnalyzer string `config:"search_analyzer"`
	Norms          bool   `config:"norms"`
	// contains filtered or unexported fields
}
    type Fields ¶
type Fields []Field
func (Fields) HasKey ¶
HasKey checks if inside fields the given key exists The key can be in the form of a.b.c and it will check if the nested field exist In case the key is `a` and there is a value `a.b` false is return as it only returns true if it's a leave node
type Loader ¶
type Loader struct {
	// contains filtered or unexported fields
}
    func NewLoader ¶
func (*Loader) CheckTemplate ¶
CheckTemplate checks if a given template already exist. It returns true if and only if Elasticsearch returns with HTTP status code 200.
func (*Loader) Load ¶
Load checks if the index mapping template should be loaded In case the template is not already loaded or overwriting is enabled, the template is written to index
func (*Loader) LoadTemplate ¶
LoadTemplate loads a template into Elasticsearch overwriting the existing template if it exists. If you wish to not overwrite an existing template then use CheckTemplate prior to calling this method.
type Template ¶
type Template struct {
	// contains filtered or unexported fields
}
    func New ¶
func New(beatVersion string, esVersion string, index string, settings TemplateSettings) (*Template, error)
New creates a new template instance
func (*Template) GetName ¶
GetName returns the name of the template which is {index}-{version}
       Source Files
      ¶
      Source Files
      ¶
    
- config.go
- field.go
- fields.go
- load.go
- template.go