{"modulePath":"github.com/devth/helm","version":"v2.0.0-alpha.2.0.20160816162624-120256ecb3a5+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package chartutil\n\nPackage chartutil contains tools for working with charts.\n\nCharts are described in the protocol buffer definition (pkg/proto/hapi/charts). This packe provides utilities for serializing and deserializing charts.\n\nA chart can be represented on the file system in one of two ways:\n\n  - As a directory that contains a Chart.yaml file and other chart things.\n  - As a tarred gzipped file containing a directory that then contains a Chart.yaml file.\n\nThis package provides utilitites for working with those file formats.\n\nThe preferred way of loading a chart is using 'chartutil.Load\\`:\n\n\tchart, err := chartutil.Load(filename)\n\nThis will attempt to discover whether the file at 'filename' is a directory or a chart archive. It will then load accordingly.\n\nFor accepting raw compressed tar file data from an io.Reader, the 'chartutil.LoadArchive()' will read in the data, uncompress it, and unpack it into a Chart.\n\nWhen creating charts in memory, use the 'k8s.io/helm/pkg/proto/happy/chart' package directly.\n\n## Constants\n\n```go\nconst (\n\t// ChartfileName is the default Chart file name.\n\tChartfileName = \"Chart.yaml\"\n\t// ValuesfileName is the default values file name.\n\tValuesfileName = \"values.yaml\"\n\t// TemplatesDir is the relative directory name for templates.\n\tTemplatesDir = \"templates\"\n\t// ChartsDir is the relative directory name for charts dependencies.\n\tChartsDir = \"charts\"\n\t// IgnorefileName is the name of the Helm ignore file.\n\tIgnorefileName = \".helmignore\"\n)\n```\n\n```go\nconst GlobalKey = \"global\"\n```\nGlobalKey is the name of the Values key that is used for storing global vars.\n\n## Functions\n\n```go\nfunc Create(chartfile *chart.Metadata, dir string) (string, 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 string will point to the newly created directory. It will be an absolute path, even if the provided base directory was relative.\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 Expand(dir string, r io.Reader) error\n```\nExpand uncompresses and extracts a chart into the specified directory.\n\n```go\nfunc Load(name string) (*chart.Chart, error)\n```\nLoad takes a string name, tries to resolve it to a file or directory, and then loads it.\n\nThis is the preferred way to load a chart. It will discover the chart encoding and hand off to the appropriate chart reader.\n\nIf a .helmignore file is present, the directory loader will skip loading any files matching it. But .helmignore is not evaluated when reading out of an archive.\n\n```go\nfunc LoadArchive(in io.Reader) (*chart.Chart, error)\n```\nLoadArchive loads from a reader containing a compressed tar archive.\n\n```go\nfunc LoadChartfile(filename string) (*chart.Metadata, error)\n```\nLoadChartfile loads a Chart.yaml file into a \\*chart.Metadata.\n\n```go\nfunc LoadDir(dir string) (*chart.Chart, error)\n```\nLoadDir loads from a directory.\n\nThis loads charts only from directories.\n\n```go\nfunc LoadFile(name string) (*chart.Chart, error)\n```\nLoadFile loads from an archive file.\n\n```go\nfunc Save(c *chart.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```go\nfunc SaveChartfile(filename string, cf *chart.Metadata) error\n```\nSaveChartfile saves the given metadata as a Chart.yaml file at the given path.\n\n'filename' should be the complete path and filename ('foo/Chart.yaml')\n\n```go\nfunc UnmarshalChartfile(data []byte) (*chart.Metadata, error)\n```\nUnmarshalChartfile takes raw Chart.yaml data and unmarshals it.\n\n## Types\n\n```go\ntype ErrNoTable error\n```\nErrNoTable indicates that a chart does not have a matching table.\n\n```go\ntype Files map[string][]byte\n```\nFiles is a map of files in a chart that can be accessed from a template.\n\n```go\nfunc NewFiles(from []*any.Any) Files\n```\nNewFiles creates a new Files from chart files. Given an \\[]\\*any.Any (the format for files in a chart.Chart), extract a map of files.\n\n```go\nfunc (f Files) Get(name string) string\n```\nGet returns a string representation of the given file.\n\nFetch the contents of a file as a string. It is designed to be called in a template.\n\n\t{{.Files.Get \"foo\"}}\n\n```go\nfunc (f Files) GetBytes(name string) []byte\n```\nGetBytes gets a file by path.\n\nThe returned data is raw. In a template context, this is identical to calling {{index .Files $path}}.\n\nThis is intended to be accessed from within a template, so a missed key returns an empty \\[]byte.\n\n```go\ntype ReleaseOptions struct {\n\tName      string\n\tTime      *timestamp.Timestamp\n\tNamespace string\n}\n```\nReleaseOptions represents the additional release options needed for the composition of the final values struct\n\n```go\ntype Values map[string]interface{}\n```\nValues represents a collection of chart values.\n\n```go\nfunc CoalesceValues(chrt *chart.Chart, vals *chart.Config) (Values, error)\n```\nCoalesceValues coalesces all of the values in a chart (and its subcharts).\n\nValues are coalesced together using the following rules:\n\n  - Values in a higher level chart always override values in a lower-level dependency chart\n  - Scalar values and arrays are replaced, maps are merged\n  - A chart has access to all of the variables for it, as well as all of the values destined for its dependencies.\n\n```go\nfunc ReadValues(data []byte) (vals Values, err error)\n```\nReadValues will parse YAML byte data into a Values.\n\n```go\nfunc ReadValuesFile(filename string) (Values, error)\n```\nReadValuesFile will parse a YAML file into a map of values.\n\n```go\nfunc ToRenderValues(chrt *chart.Chart, chrtVals *chart.Config, options ReleaseOptions) (Values, error)\n```\nToRenderValues composes the struct from the data coming from the Releases, Charts and Values files\n\n```go\nfunc (v Values) AsMap() map[string]interface{}\n```\nAsMap is a utility function for converting Values to a map\\[string]interface{}.\n\nIt protects against nil map panics.\n\n```go\nfunc (v Values) Encode(w io.Writer) error\n```\nEncode writes serialized Values information to the given io.Writer.\n\n```go\nfunc (v Values) Table(name string) (Values, error)\n```\nTable gets a table (YAML subsection) from a Values object.\n\nThe table is returned as a Values.\n\nCompound table names may be specified with dots:\n\n\tfoo.bar\n\nThe above will be evaluated as \"The table bar inside the table foo\".\n\nAn ErrNoTable is returned if the table does not exist.\n\n```go\nfunc (v Values) YAML() (string, error)\n```\nYAML encodes the Values into a YAML string.\n\n","path":"github.com/devth/helm/pkg/chartutil","name":"chartutil","synopsis":"Package chartutil contains tools for working with charts.","isRedistributable":true}
