{"modulePath":"github.com/devth/helm","version":"v1.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package chart\n\nPackage chart implements the Chart format.\n\nThis package provides tools for working with the Chart format, including the Chartfile (chart.yaml) and compressed chart archives.\n\n## Constants\n\n```go\nconst (\n\tSchemeHTTP  = \"http\"\n\tSchemeHTTPS = \"https\"\n\tSchemeHelm  = \"helm\"\n\tSchemeFile  = \"file\"\n)\n```\nConstants defining recognized URL schemes.\n\n```go\nconst ChartfileName string = \"Chart.yaml\"\n```\nChartfileName is the default Chart file name.\n\n```go\nconst TarNameRegex = `([0-9A-Za-z\\-_/]+)-(v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?` +\n\t`(-([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?` +\n\t`(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?)(.tgz)?`\n```\nTarNameRegex parses the name component of a URI and breaks it into a name and version.\n\nThis borrows liberally from github.com/Masterminds/semver.\n\n## Variables\n\n```go\nvar ErrLocal = errors.New(\"cannot use local Locator as remote\")\n```\nErrLocal indicates that a local URL was used as a remote URL.\n\n```go\nvar ErrRemote = errors.New(\"cannot use remote Locator as local\")\n```\nErrRemote indicates that a remote URL was used as a local URL.\n\n## Functions\n\n```go\nfunc Save(c *Chart, outDir string) (string, error)\n```\nSave creates an archived chart to the given directory.\n\nThis takes an existing chart and a destination directory.\n\nIf the directory is /foo, and the chart is named bar, with version 1.0.0, this will generate /foo/bar-1.0.0.tgz.\n\nThis returns the absolute path to the chart archive file.\n\n## Types\n\n```go\ntype Chart struct {\n\t// contains filtered or unexported fields\n}\n```\nChart represents a complete chart.\n\nA chart consists of the following parts:\n\n  - Chart.yaml: In code, we refer to this as the Chartfile\n  - templates/\\*: The template directory\n  - README.md: Optional README file\n  - LICENSE: Optional license file\n  - hooks/: Optional hooks registry\n  - docs/: Optional docs directory\n\nPacked charts are stored in gzipped tar archives (.tgz). Unpackaged charts are directories where the directory name is the Chartfile.Name.\n\nOptionally, a chart might also locate a provenance (.prov) file that it can use for cryptographic signing.\n\n```go\nfunc Create(chartfile *Chartfile, dir string) (*Chart, error)\n```\nCreate creates a new chart in a directory.\n\nInside of dir, this will create a directory based on the name of chartfile.Name. It will then write the Chart.yaml into this directory and create the (empty) appropriate directories.\n\nThe returned \\*Chart will point to the newly created directory.\n\nIf dir does not exist, this will return an error. If Chart.yaml or any directories cannot be created, this will return an error. In such a case, this will attempt to clean up by removing the new chart directory.\n\n```go\nfunc Load(archive string) (*Chart, error)\n```\nLoad loads a chart from a chart archive.\n\nA chart archive is a gzipped tar archive that follows the Chart format specification.\n\n```go\nfunc LoadData(data []byte) (*Chart, error)\n```\nLoadData loads a chart from data, where data is a \\[]byte containing a gzipped tar file.\n\n```go\nfunc LoadDir(chart string) (*Chart, error)\n```\nLoadDir loads an entire chart from a directory.\n\nThis includes the Chart.yaml (\\*Chartfile) and all of the manifests.\n\nIf you are just reading the Chart.yaml file, it is substantially more performant to use LoadChartfile.\n\n```go\nfunc (c *Chart) Chartfile() *Chartfile\n```\nChartfile gets the Chartfile (Chart.yaml) for this chart.\n\n```go\nfunc (c *Chart) Close() error\n```\nClose the chart.\n\nCharts should always be closed when no longer needed.\n\n```go\nfunc (c *Chart) Dir() string\n```\nDir returns the directory where the charts are located.\n\n```go\nfunc (c *Chart) DocsDir() string\n```\nDocsDir returns the directory where the chart's documentation is stored.\n\n```go\nfunc (c *Chart) HooksDir() string\n```\nHooksDir returns the directory where the hooks are stored.\n\n```go\nfunc (c *Chart) Icon() (string, error)\n```\nIcon returns the path to the icon.svg file.\n\nIf an icon is not found in the chart, this will return an error.\n\n```go\nfunc (c *Chart) TemplatesDir() string\n```\nTemplatesDir returns the directory where the templates are stored.\n\n```go\ntype Chartfile struct {\n\tName         string           `yaml:\"name\"`\n\tDescription  string           `yaml:\"description\"`\n\tVersion      string           `yaml:\"version\"`\n\tKeywords     []string         `yaml:\"keywords,omitempty\"`\n\tMaintainers  []*Maintainer    `yaml:\"maintainers,omitempty\"`\n\tSource       []string         `yaml:\"source,omitempty\"`\n\tHome         string           `yaml:\"home\"`\n\tDependencies []*Dependency    `yaml:\"dependencies,omitempty\"`\n\tEnvironment  []*EnvConstraint `yaml:\"environment,omitempty\"`\n}\n```\nChartfile describes a Helm Chart (e.g. Chart.yaml)\n\n```go\nfunc LoadChartfile(filename string) (*Chartfile, error)\n```\nLoadChartfile loads a Chart.yaml file into a \\*Chart.\n\n```go\nfunc (c *Chartfile) Marshal() ([]byte, error)\n```\nMarshal encodes the chart file into YAML.\n\n```go\nfunc (c *Chartfile) Save(filename string) error\n```\nSave saves a Chart.yaml file\n\n```go\ntype Dependency struct {\n\tName     string `yaml:\"name,omitempty\"`\n\tVersion  string `yaml:\"version\"`\n\tLocation string `yaml:\"location\"`\n}\n```\nDependency describes a specific dependency.\n\n```go\nfunc (d *Dependency) VersionOK(version string) bool\n```\nVersionOK returns true if the given version meets the constraints.\n\nIt returns false if the version string or constraint is unparsable or if the version does not meet the constraint.\n\n```go\ntype EnvConstraint struct {\n\tName       string   `yaml:\"name\"`\n\tVersion    string   `yaml:\"version\"`\n\tExtensions []string `yaml:\"extensions,omitempty\"`\n\tAPIGroups  []string `yaml:\"apiGroups,omitempty\"`\n}\n```\nEnvConstraint specifies environmental constraints.\n\n```go\ntype Locator struct {\n\t// The scheme of the URL. Typically one of http, https, helm, or file.\n\tScheme string\n\t// The host information, if applicable.\n\tHost string\n\t// The bucket name\n\tBucket string\n\t// The chart name\n\tName string\n\t// The version or version range.\n\tVersion string\n\n\t// If this is a local chart, the path to the chart.\n\tLocalRef string\n\t// contains filtered or unexported fields\n}\n```\nLocator describes the location of a Chart.\n\n```go\nfunc Parse(path string) (*Locator, error)\n```\nParse parses a URL into a Locator.\n\n```go\nfunc (u *Locator) IsLocal() bool\n```\nIsLocal returns true if this is a local path.\n\n```go\nfunc (u *Locator) Local() (string, error)\n```\nLocal returns a local version of the path.\n\nThis will return an error if the URL does not reference a local chart.\n\n```go\nfunc (u *Locator) Long(secure bool) (string, error)\n```\nLong returns a long-form URL.\n\nIf secure is true, this will return an HTTPS URL, otherwise HTTP.\n\nThis will return an error if the URL references a local chart.\n\n```go\nfunc (u *Locator) Short() (string, error)\n```\nShort returns a short form URL.\n\nThis will return an error if the URL references a local chart.\n\n```go\ntype Maintainer struct {\n\tName  string `yaml:\"name\"`\n\tEmail string `yaml:\"email,omitempty\"`\n}\n```\nMaintainer describes a chart maintainer.\n\n","path":"github.com/devth/helm/chart","name":"chart","synopsis":"Package chart implements the Chart format.","isRedistributable":true}
