helpers

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const APIVer1String = "v1"

APIVer1String is the API version 1 string we include in route URLs

Variables

This section is empty.

Functions

func AddCanonicalLink(resource *swaggermodels.Resource)

AddCanonicalLink adds a "self" link to a chart resource's canonical API endpoint

func AddChartRelationship

func AddChartRelationship(db datastore.Database, resource *swaggermodels.Resource, chartPackage *swaggermodels.ChartPackage)

AddChartRelationship adds a "relationships" reference to a chartVersion resource's chart

func AddLatestChartVersionRelationship

func AddLatestChartVersionRelationship(resource *swaggermodels.Resource, chartPackage *swaggermodels.ChartPackage)

AddLatestChartVersionRelationship adds a "relationships" reference to a chart resource's latest chartVersion

func GetChartVersion

func GetChartVersion(charts []*swaggermodels.ChartPackage, name, version string) (*swaggermodels.ChartPackage, error)

GetChartVersion returns a specific versions of a chart

func GetChartVersions

func GetChartVersions(charts []*swaggermodels.ChartPackage, name string) ([]*swaggermodels.ChartPackage, error)

GetChartVersions returns all versions of a chart

func GetLatestChartVersion

func GetLatestChartVersion(charts []*swaggermodels.ChartPackage, name string) (*swaggermodels.ChartPackage, error)

GetLatestChartVersion returns the most recent version from a slice of versioned charts

func IsYAML

func IsYAML(b []byte) bool

IsYAML checks for valid YAML

func MakeChartID

func MakeChartID(repo, chart string) string

MakeChartID returns a chart ID in the form {:repo}/{:chart}

func MakeChartResource

func MakeChartResource(db datastore.Database, chart *swaggermodels.ChartPackage) *swaggermodels.Resource

MakeChartResource composes a Resource type that represents a repo+chart

func MakeChartResources

func MakeChartResources(db datastore.Database, charts []*swaggermodels.ChartPackage) []*swaggermodels.Resource

MakeChartResources accepts a slice of repo+chart data, converts each to a Resource type and then returns the slice of the converted Resource types (throwing away version information, and collapsing all chart+version records into a single resource representation for each chart)

func MakeChartVersionID

func MakeChartVersionID(repo, chart, version string) string

MakeChartVersionID returns a chartVersion ID in the form {:repo}/{:chart}:{:version}

func MakeChartVersionResource

func MakeChartVersionResource(db datastore.Database, chart *swaggermodels.ChartPackage) *swaggermodels.Resource

MakeChartVersionResource composes a Resource type that represents a chartVersion

func MakeChartVersionResources

func MakeChartVersionResources(db datastore.Database, charts []*swaggermodels.ChartPackage) []*swaggermodels.Resource

MakeChartVersionResources accepts a slice of versioned repo+chart data, converts each to a Resource type and then returns the slice of the converted Resource types (retaining version info)

func MakeRepoChartRouteURL

func MakeRepoChartRouteURL(apiVer, repo, name string) string

MakeRepoChartRouteURL returns a string that represents /{:apiVersion}/charts/{:repo}/{:chart}

func MakeRepoChartVersionRouteURL

func MakeRepoChartVersionRouteURL(apiVer, repo, name, version string) string

MakeRepoChartVersionRouteURL returns a string that represents /{:apiVersion}/charts/{:repo}/{:chart}/versions/{:version}

func MakeRepoResource

func MakeRepoResource(repo *models.Repo) *swaggermodels.Resource

MakeRepoResource composes a Resource type that represents a repository

func MakeRepoResources

func MakeRepoResources(repos []*models.Repo) []*swaggermodels.Resource

MakeRepoResources returns an array of RepoResources

func ParseYAMLRepo

func ParseYAMLRepo(rawYAML []byte, repoName string) ([]*swaggermodels.ChartPackage, error)

ParseYAMLRepo converts a YAML representation of a repo to a slice of charts

Types

This section is empty.

Jump to

Keyboard shortcuts

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