/elit

Generate elasticsearch index template from golang source code

Primary LanguageGoMIT LicenseMIT

elit

CircleCI Go Report CardFOSSA Status GoDoc

Generate elasticsearch index template from golang source code

Installation

$ go get github.com/fidelitywires/elit

Usage

type Human struct {
	Name string
	Age  int
}

t := elit.Template{
	Template: "sample_template_*",
	Settings: elit.Settings{
		NumberOfShards:   5,
		NumberOfReplicas: 1,
	},
}

p, err := elit.Generate(Human{}, nil)

t.Mappings["sample"] = elit.Type{
	Properties: p,
}

This is sample so see also ExampleGenerate function.

FOSSA Status