func NewIndexFlat(metricType MetricType, 
	nlist int,
) (*IndexFlat, error) {
	if nlist < 1 {
		return nil, errors.New("nlist not valid")
	}
	if nlist > 65536 {
		return nil, errors.New("nlist not valid")
	}
	return &IndexFlat{ 
	nlist: nlist,
	metricType: metricType,
	}, nil
}
NewIndexFlat create index with contruction parameters
package entity
import (
	"errors"
	"encoding/json"
	"fmt"
)
var _ Index = &IndexFlat{}
type IndexFlat struct {  
	nlist int
	metricType MetricType
}
func(i *IndexFlat) Name() string {
	return "Flat"
}
func(i *IndexFlat) IndexType() IndexType {
	return IndexType("FLAT")
}
func(i *IndexFlat) SupportBinary() bool {
	return 0 & 2 > 0
}
func(i *IndexFlat) Params() map[string]string {
	params := map[string]string { 
		"nlist": fmt.Sprintf("%v",i.nlist),
	}
	bs, _ := json.Marshal(params)
	return map[string]string {
		"params": string(bs),
		"index_type": string(i.IndexType()),
		"metric_type": string(i.metricType),
	}
}