chartfs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedFiles

type BufferedFiles struct {
	// contains filtered or unexported fields
}

BufferedFiles represents the group of files needed to load a Helm chart in memory, the files data is stored as `loader.BufferedFile` instances.

func NewBufferedFiles

func NewBufferedFiles(cfs fs.FS, baseDir string) *BufferedFiles

NewBufferedFiles creates a new BufferedFiles instance.

func (*BufferedFiles) Files

func (b *BufferedFiles) Files() []*loader.BufferedFile

Files returns the buffered files collected by "Walk" function.

func (*BufferedFiles) Walk

func (b *BufferedFiles) Walk(filePath string, d fs.DirEntry, err error) error

Walk is the callback function used by "fs.WalkDir" to collect the files data.

type ChartFS

type ChartFS struct {
	// contains filtered or unexported fields
}

ChartFS represents a file system abstraction which provides the Helm charts payload, and as well the "values.yaml.tpl" file. It uses an underlying fs.FS as data source.

func New

func New(filesystem fs.FS) *ChartFS

New creates a ChartFS from any filesystem.

func (*ChartFS) GetAllCharts

func (c *ChartFS) GetAllCharts() ([]chart.Chart, error)

GetAllCharts retrieves all Helm charts from the filesystem.

func (*ChartFS) GetChartFiles

func (c *ChartFS) GetChartFiles(chartPath string) (*chart.Chart, error)

GetChartFiles returns the informed Helm chart path instantiated files.

func (*ChartFS) Open

func (c *ChartFS) Open(name string) (fs.File, error)

Open opens the named file. Implements "fs.FS" interface.

func (*ChartFS) ReadFile

func (c *ChartFS) ReadFile(name string) ([]byte, error)

ReadFile reads the file from the file system. It supports absolute paths (read from the OS filesystem), relative paths that exist in the OS filesystem (converted to absolute), and relative paths from the embedded filesystem.

func (*ChartFS) WithBaseDir

func (c *ChartFS) WithBaseDir(baseDir string) (*ChartFS, error)

WithBaseDir returns a new ChartFS that is rooted at the given base directory.

type OverlayFS

type OverlayFS struct {
	Embedded fs.FS // embedded data (first)
	Local    fs.FS // local data (second)
}

OverlayFS implements fs.FS and looks for files in the embedded filesystem first, then the local filesystem.

func NewOverlayFS

func NewOverlayFS(embedded, local fs.FS) *OverlayFS

NewOverlayFS creates a new OverlayFS with the given embedded and local filesystems.

func (*OverlayFS) Open

func (o *OverlayFS) Open(name string) (fs.File, error)

Open opens the named file, when it doesn't exist in the embedded FS it falls back to the local.

func (*OverlayFS) WithEmbeddedBaseDir

func (o *OverlayFS) WithEmbeddedBaseDir(baseDir string) (*OverlayFS, error)

WithEmbeddedBaseDir returns a new OverlayFS with the embedded filesystem rooted at the given base directory, while keeping the local filesystem unchanged.

Jump to

Keyboard shortcuts

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