...

Source file src/helm.sh/helm/v3/pkg/helmpath/home.go

Documentation: helm.sh/helm/v3/pkg/helmpath

     1  // Copyright The Helm Authors.
     2  // Licensed under the Apache License, Version 2.0 (the "License");
     3  // you may not use this file except in compliance with the License.
     4  // You may obtain a copy of the License at
     5  
     6  // http://www.apache.org/licenses/LICENSE-2.0
     7  
     8  // Unless required by applicable law or agreed to in writing, software
     9  // distributed under the License is distributed on an "AS IS" BASIS,
    10  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  // Package helmpath calculates filesystem paths to Helm's configuration, cache and data.
    15  package helmpath
    16  
    17  // This helper builds paths to Helm's configuration, cache and data paths.
    18  const lp = lazypath("helm")
    19  
    20  // ConfigPath returns the path where Helm stores configuration.
    21  func ConfigPath(elem ...string) string { return lp.configPath(elem...) }
    22  
    23  // CachePath returns the path where Helm stores cached objects.
    24  func CachePath(elem ...string) string { return lp.cachePath(elem...) }
    25  
    26  // DataPath returns the path where Helm stores data.
    27  func DataPath(elem ...string) string { return lp.dataPath(elem...) }
    28  
    29  // CacheIndexFile returns the path to an index for the given named repository.
    30  func CacheIndexFile(name string) string {
    31  	if name != "" {
    32  		name += "-"
    33  	}
    34  	return name + "index.yaml"
    35  }
    36  
    37  // CacheChartsFile returns the path to a text file listing all the charts
    38  // within the given named repository.
    39  func CacheChartsFile(name string) string {
    40  	if name != "" {
    41  		name += "-"
    42  	}
    43  	return name + "charts.txt"
    44  }
    45  

View as plain text