helpers

package
v0.0.0-...-43166c5 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: Apache-2.0 Imports: 7 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 *models.Resource)

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

func AddChartRelationship

func AddChartRelationship(resource *models.Resource, chartPackage *models.ChartPackage)

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

func AddLatestChartVersionRelationship

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

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

func GetChartVersion

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

GetChartVersion returns a specific versions of a chart

func GetChartVersions

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

GetChartVersions returns all versions of a chart

func GetLatestChartVersion

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

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

func Int64ToPtr

func Int64ToPtr(n int64) *int64

Int64ToPtr converts an int64 to an *int64

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(chart *models.ChartPackage) *models.Resource

MakeChartResource composes a Resource type that represents a repo+chart

func MakeChartResources

func MakeChartResources(charts []*models.ChartPackage) []*models.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(chart *models.ChartPackage) *models.Resource

MakeChartVersionResource composes a Resource type that represents a chartVersion

func MakeChartVersionResources

func MakeChartVersionResources(charts []*models.ChartPackage) []*models.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 repos.Repo) *models.Resource

MakeRepoResource composes a Resource type that represents a repository

func MakeRepoResources

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

MakeRepoResources returns an array of RepoResources

func ParseYAMLRepo

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

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

func StrToPtr

func StrToPtr(s string) *string

StrToPtr converts a string to a *string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳