helmrepo

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package helmrepo provides functionality for managing Helm chart repositories.

This package handles repository operations such as adding, updating, and fetching from Helm chart repositories. It supports authentication, TLS, and other repository configuration options.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultManager = NewManager()

	ErrRepoNameEmpty       = errors.New("repo name cannot be empty")
	ErrRepoURLEmpty        = errors.New("repo URL cannot be empty")
	ErrFailedToResolveURL  = errors.New("failed to resolve URL")
	ErrFailedToResolveFile = errors.New("failed to resolve file path")
	ErrInvalidRepoURL      = errors.New("invalid repository URL")
)

Functions

This section is empty.

Types

type DuplicateRepoError

type DuplicateRepoError struct {
	Name string
}

func (DuplicateRepoError) Error

func (err DuplicateRepoError) Error() string

type Getter

type Getter interface {
	Get(repo string) (*Repo, error)
}

type Manager

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

Manager manages a collection of [Repo]s.

func NewManager

func NewManager(opt ...ManagerOpt) *Manager

NewManager creates a new Manager.

func (*Manager) Add

func (m *Manager) Add(repoOpts *RepoOpts) error

Add uses RepoOpts to create and add a new Repo to the Manager. An error is returned if the Repo could not be generated, or if a Repo with the same Name and/or URL already exists.

func (*Manager) Get

func (m *Manager) Get(repo string) (*Repo, error)

Get returns a repo by its name or URL. It calls Manager.GetByName or Manager.GetByURL depending on the input.

func (*Manager) GetByName

func (m *Manager) GetByName(name string) (*Repo, error)

GetByName returns a repo by its name. If the repo does not exist in the Manager, an error is returned.

func (*Manager) GetByURL

func (m *Manager) GetByURL(repoURL string) (*Repo, error)

GetByURL returns a Repo by its URL. If the Repo does not exist in the Manager, a new Repo is created with the URL as the name.

type ManagerOpt

type ManagerOpt func(*Manager)

ManagerOpt is a functional option for Manager.

func WithAllowedPaths

func WithAllowedPaths(currentPath, repoRoot string) ManagerOpt

func WithAllowedURLSchemes

func WithAllowedURLSchemes(schemes ...string) ManagerOpt

WithAllowedURLSchemes sets the allowed URL schemes for the Manager.

type Repo

type Repo struct {
	// Helm chart repository name for reference by `@name`.
	Name                  string
	URL                   paths.ResolvedFilePath
	Username              string
	Password              string
	CAPath                paths.ResolvedFileOrDirectoryPath
	TLSClientCertDataPath paths.ResolvedFileOrDirectoryPath
	TLSClientCertKeyPath  paths.ResolvedFileOrDirectoryPath
	InsecureSkipVerify    bool
	PassCredentials       bool
}

func (*Repo) IsLocal

func (r *Repo) IsLocal() bool

IsLocal returns true if the repo URL is a local file path.

type RepoNotFoundError

type RepoNotFoundError struct {
	Name string
}

func (RepoNotFoundError) Error

func (err RepoNotFoundError) Error() string

type RepoOpts

type RepoOpts struct {
	// Helm chart repository name for reference by `@name`.
	Name                  string `json:"name"`
	URL                   string `json:"url"`
	Username              string `json:"username,omitempty"`
	Password              string `json:"password,omitempty"`
	CAPath                string `json:"caPath,omitempty"`
	TLSClientCertDataPath string `json:"tlsClientCertDataPath,omitempty"`
	TLSClientCertKeyPath  string `json:"tlsClientCertKeyPath,omitempty"`
	InsecureSkipVerify    bool   `json:"insecureSkipVerify"`
	PassCredentials       bool   `json:"passCredentials"`
}

func (*RepoOpts) Validate

func (r *RepoOpts) Validate() error

Jump to

Keyboard shortcuts

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