func NewIndexFile() *IndexFile {
	return &IndexFile{
		APIVersion: APIVersionV1,
		Generated:  time.Now(),
		Entries:    map[string]ChartVersions{},
		PublicKeys: []string{},
	}
}
NewIndexFile initializes an index.
package repo
import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"sort"
	"strings"
	"time"
	"github.com/Masterminds/semver"
	"github.com/ghodss/yaml"
	"k8s.io/helm/pkg/chartutil"
	"k8s.io/helm/pkg/proto/hapi/chart"
	"k8s.io/helm/pkg/provenance"
	"k8s.io/helm/pkg/urlutil"
)
var indexPath = "index.yaml"
const APIVersionV1 = "v1"
var (
	ErrNoAPIVersion = errors.New("no API version specified")
	ErrNoChartVersion = errors.New("no chart version found")
	ErrNoChartName = errors.New("no chart name found")
)
type ChartVersions []*ChartVersion
func (c ChartVersions) Len() int { return len(c) }
func (c ChartVersions) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c ChartVersions) Less(a, b int) bool {
	i, err := semver.NewVersion(c[a].Version)
	if err != nil {
		return true
	}
	j, err := semver.NewVersion(c[b].Version)
	if err != nil {
		return false
	}
	return i.LessThan(j)
}
type IndexFile struct {
	APIVersion string                   `json:"apiVersion"`
	Generated  time.Time                `json:"generated"`
	Entries    map[string]ChartVersions `json:"entries"`
	PublicKeys []string                 `json:"publicKeys,omitempty"`
}