charts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencyCacheFolder = ".helm_ls_cache"

Functions

func IsDependencyFile added in v0.1.0

func IsDependencyFile(d PossibleDependencyFile) bool

func SyncToDisk added in v0.1.0

func SyncToDisk(d PossibleDependencyFile)

SyncToDisk writes the content of the document to disk if it is a dependency file. If it is a dependency file, it was read from a archive, so we need to write it back, to be able to open it in a editor when using go-to-definition or go-to-reference.

Types

type Chart

type Chart struct {
	ValuesFiles   *ValuesFiles
	ChartMetadata *ChartMetadata
	RootURI       uri.URI
	ParentChart   ParentChart
	HelmChart     *chart.Chart
}

func NewChart

func NewChart(rootURI uri.URI, valuesFilesConfig util.ValuesFilesConfig) *Chart

func NewChartFromHelmChart added in v0.1.0

func NewChartFromHelmChart(helmChart *chart.Chart, rootURI uri.URI) *Chart

func (*Chart) GetDependeciesTemplates added in v0.1.0

func (c *Chart) GetDependeciesTemplates() []*DependencyTemplateFile

func (*Chart) GetDependecyURI added in v0.1.0

func (c *Chart) GetDependecyURI(dependencyName string) uri.URI

func (*Chart) GetMetadataLocation added in v0.1.0

func (c *Chart) GetMetadataLocation(templateContext []string) (lsp.Location, error)

func (*Chart) NewDependencyTemplateFile added in v0.1.0

func (c *Chart) NewDependencyTemplateFile(chartName string, file *chart.File) *DependencyTemplateFile

func (*Chart) ResolveValueFiles

func (c *Chart) ResolveValueFiles(query []string, chartStore *ChartStore) (result []*QueriedValuesFiles)

ResolveValueFiles returns a list of all values files in the chart and all parent and dependency charts with the adjusted query

func (*Chart) ResolveValueFilesRecursive added in v0.1.0

func (c *Chart) ResolveValueFilesRecursive(query []string, chartStore *ChartStore, result map[uri.URI]*QueriedValuesFiles)

type ChartMetadata

type ChartMetadata struct {
	YamlNode yaml.Node
	Metadata chart.Metadata
	URI      uri.URI
}

func NewChartMetadata

func NewChartMetadata(rootURI uri.URI) *ChartMetadata

func NewChartMetadataForDependencyChart added in v0.1.0

func NewChartMetadataForDependencyChart(metadata *chart.Metadata, URI uri.URI) *ChartMetadata

Create a new ChartMetadata for a dependency chart, omitting the YamlNode since this is likely not required for dependency charts

type ChartStore

type ChartStore struct {
	Charts  map[uri.URI]*Chart
	RootURI uri.URI
	// contains filtered or unexported fields
}

func NewChartStore

func NewChartStore(rootURI uri.URI, newChart func(uri.URI, util.ValuesFilesConfig) *Chart, addChartCallback func(chart *Chart)) *ChartStore

func (*ChartStore) AddChart added in v0.1.0

func (s *ChartStore) AddChart(chart *Chart)

AddChart adds a new chart to the store and loads its dependencies

func (*ChartStore) GetChartForDoc

func (s *ChartStore) GetChartForDoc(uri lsp.DocumentURI) (*Chart, error)

func (*ChartStore) GetChartForURI

func (s *ChartStore) GetChartForURI(fileURI uri.URI) (*Chart, error)

func (*ChartStore) GetChartOrParentForDoc added in v0.0.14

func (s *ChartStore) GetChartOrParentForDoc(uri lsp.DocumentURI) (*Chart, error)

func (*ChartStore) ReloadValuesFile

func (s *ChartStore) ReloadValuesFile(file uri.URI)

func (*ChartStore) SetValuesFilesConfig

func (s *ChartStore) SetValuesFilesConfig(valuesFilesConfig util.ValuesFilesConfig)

type DependencyTemplateFile added in v0.1.0

type DependencyTemplateFile struct {
	Content []byte
	Path    string
}

type ErrChartNotFound

type ErrChartNotFound struct {
	URI lsp.DocumentURI
}

func (ErrChartNotFound) Error

func (e ErrChartNotFound) Error() string

type ParentChart

type ParentChart struct {
	ParentChartURI uri.URI
	HasParent      bool
}

func (*ParentChart) GetParentChart

func (p *ParentChart) GetParentChart(chartStore *ChartStore) *Chart

func (*ParentChart) GetParentChartRecursive added in v0.0.14

func (p *ParentChart) GetParentChartRecursive(chartStore *ChartStore) *Chart

type PossibleDependencyFile added in v0.1.0

type PossibleDependencyFile interface {
	GetContent() []byte
	GetPath() string
}

type QueriedValuesFiles

type QueriedValuesFiles struct {
	Selector    []string
	ValuesFiles *ValuesFiles
}

type ValuesFile

type ValuesFile struct {
	Values    chartutil.Values
	ValueNode yaml.Node
	URI       uri.URI
	// contains filtered or unexported fields
}

func NewValuesFileFromContent added in v0.1.0

func NewValuesFileFromContent(uri uri.URI, data []byte) *ValuesFile

func NewValuesFileFromPath added in v0.1.0

func NewValuesFileFromPath(filePath string) *ValuesFile

func (*ValuesFile) GetContent added in v0.1.0

func (v *ValuesFile) GetContent() []byte

GetContent implements PossibleDependencyFile.

func (*ValuesFile) GetPath added in v0.1.0

func (v *ValuesFile) GetPath() string

GetPath implements PossibleDependencyFile.

func (*ValuesFile) Reload

func (v *ValuesFile) Reload()

type ValuesFiles

type ValuesFiles struct {
	MainValuesFile        *ValuesFile
	OverlayValuesFile     *ValuesFile
	AdditionalValuesFiles []*ValuesFile
}

func NewValuesFiles

func NewValuesFiles(rootURI uri.URI, mainValuesFileName string, lintOverlayValuesFile string, additionalValuesFilesGlob string) *ValuesFiles

func (*ValuesFiles) AllValuesFiles

func (v *ValuesFiles) AllValuesFiles() []*ValuesFile

func (*ValuesFiles) GetPositionsForValue

func (v *ValuesFiles) GetPositionsForValue(query []string) []lsp.Location

Jump to

Keyboard shortcuts

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