chart

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package chart acquires and caches HTTP and OCI Helm charts for offline render paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCacheDir

func DefaultCacheDir() (string, error)

func IsPathInsideAny added in v0.1.7

func IsPathInsideAny(targetPath string, roots []string) (bool, string, error)

func NewCacheKey

func NewCacheKey(request Request) (string, error)

func NormalizeCacheRepository

func NormalizeCacheRepository(repository string, kind RepositoryKind) (string, error)

func NormalizeRepository

func NormalizeRepository(repository string, kind RepositoryKind) (string, error)

func ResolveCacheDir added in v0.1.7

func ResolveCacheDir(cacheDir string, forbiddenRoots []string) (string, error)

Types

type Acquirer

type Acquirer interface {
	Acquire(ctx context.Context, request Request, opts Options) (Result, error)
}

type ChartCredentials

type ChartCredentials struct {
	Username       string
	Password       string
	BearerToken    string
	RegistryConfig string
}

type DefaultAcquirer

type DefaultAcquirer struct {
	Client    *http.Client
	OCIPuller OCIPuller
}

func (DefaultAcquirer) Acquire

func (acquirer DefaultAcquirer) Acquire(ctx context.Context, request Request, opts Options) (Result, error)

type HelmOCIPuller

type HelmOCIPuller struct {
	Client *http.Client
}

func (HelmOCIPuller) Pull

func (puller HelmOCIPuller) Pull(ctx context.Context, request Request, opts Options) ([]byte, error)

type OCIPuller

type OCIPuller interface {
	Pull(ctx context.Context, request Request, opts Options) ([]byte, error)
}

type Options

type Options struct {
	CacheDir        string
	Offline         bool
	Refresh         bool
	ForbiddenRoots  []string
	PassCredentials bool
	Credentials     ChartCredentials
}

type RepositoryKind

type RepositoryKind string
const (
	RepositoryHTTP RepositoryKind = "http"
	RepositoryOCI  RepositoryKind = "oci"
)

type Request

type Request struct {
	Repository string
	Name       string
	Version    string
	Kind       RepositoryKind
}

type Result

type Result struct {
	ChartDir   string
	Repository string
	Name       string
	Version    string
	Kind       RepositoryKind
	FromCache  bool
}

Jump to

Keyboard shortcuts

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