func (prod *ElasticSearch) Configure(conf core.PluginConfigReader) {
	prod.connection.servers = conf.GetStringArray("Servers", []string{"http://127.0.0.1:9200"})
	prod.connection.user = conf.GetString("User", "")
	prod.connection.password = conf.GetString("Password", "")
	prod.connection.setGzip = conf.GetBool("SetGzip", false)
	prod.connection.isConnectedStatus = false
	prod.configureIndexSettings(conf.GetMap("StreamProperties", tcontainer.NewMarshalMap()), conf.Errors)
	prod.configureRetrySettings(conf.GetInt("Retry/Count", 3), conf.GetInt("Retry/TimeToWaitSec", 3))
}
Configure initializes this producer with values from a plugin config.
package producer
import (
	"context"
	"net/http"
	"sync"
	"syscall"
	"time"
	"gollum/core"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"github.com/trivago/tgo"
	"github.com/trivago/tgo/tcontainer"
	"gopkg.in/olivere/elastic.v5"
)
type ElasticSearch struct {
	core.BatchedProducer `gollumdoc:"embed_type"`
	connection           elasticConnection
	indexMap             map[core.MessageStreamID]*indexMapItem
}
type indexMapItem struct {
	name         string
	typeName     string
	settings     *elasticIndex
	useTimeIndex bool
	timeFormat   string
}
func newIndexMapItem() *indexMapItem {
	return &indexMapItem{
		timeFormat: "2006-01-02",
	}
}
func (item *indexMapItem) GetIndexName(t time.Time) string {
	if item.useTimeIndex {
		return item.name + t.Format(item.timeFormat)
	}
	return item.name
}
type elasticIndex struct {
	Settings map[string]interface{}    `json:"settings,omitempty"`
	Mappings map[string]elasticMapping `json:"mappings,omitempty"`
}
type elasticMapping struct {
	Properties map[string]elasticType `json:"properties,omitempty"`
}
type elasticType struct {
	TypeName interface{} `json:"type"`
}
func newElasticIndex(property tcontainer.MarshalMap) *elasticIndex {
	elType, _ := property.String("Type")
	mapping, _ := property.MarshalMap("Mapping")
	settings, _ := property.MarshalMap("Settings")
	elMappings := elasticMapping{
		Properties: make(map[string]elasticType),
	}
	for fieldName := range mapping {
		typeName, _ := mapping.String(fieldName)
		elMappings.Properties[fieldName] = elasticType{TypeName: typeName}
	}
	elIndex := elasticIndex{
		Settings: make(map[string]interface{}),
		Mappings: make(map[string]elasticMapping),
	}
	elIndex.Mappings[elType] = elMappings
	elIndex.Settings = settings
	return &elIndex
}
func init() {
	core.TypeRegistry.Register(ElasticSearch{})
}