datasource

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package datasource resolves a values/store file reference (FileRef.Src) into bytes. Nothing more: merging of multiple values files is left to nelm (Helm-native ordered merge), so this package only turns a reference into content.

Local paths (schemeless or file://) are read straight from disk, relative to the resolver's base directory. Every other scheme (env:, http(s)://, s3://, vault://, git://, ...) is read through gomplate v5's `include`, which returns the raw datasource content. The content is then post-processed by extension: *.sops is decrypted, *.tpl/*.tmpl are rendered as gomplate templates, and everything else is copied verbatim. The two compose: *.tpl.sops is decrypted first, then rendered.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEncrypted

func IsEncrypted(src string) bool

IsEncrypted reports whether src is a sops source, i.e. whether resolving it writes decrypted content to disk. Callers use it to warn about what ends up in the build directory.

Types

type Resolver

type Resolver struct {
	// BaseDir is the directory schemeless (local) paths resolve against.
	BaseDir string
}

Resolver reads datasource references relative to a base directory.

func NewResolver

func NewResolver(baseDir string) *Resolver

NewResolver returns a Resolver rooted at baseDir.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, src string, datasources map[string]string) ([]byte, error)

Resolve fetches src and post-processes it by extension. For *.tpl sources the given datasources (name -> URL) are exposed to the template via ds/include.

Jump to

Keyboard shortcuts

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