Help us shape the future of Go! Take the 2026 Go Developer Survey

repohelper

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetChartsFromRepoIndexFile = func(repo *models.Repo) ([]*swaggermodels.ChartPackage, error) {
	u, _ := url.Parse(repo.URL)
	u.Path = path.Join(u.Path, "index.yaml")

	// 1 - Download repo index
	var client http.Client
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		return nil, err
	}
	req.Header.Set("User-Agent", version.GetUserAgent())
	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	charts, err := helpers.ParseYAMLRepo(body, repo.Name)
	if err != nil {
		return nil, err
	}

	return charts, nil
}

GetRepoIndexFile Get the charts from the index file

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL