extensions

package
v0.85.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package extensions contains the install/upgrades/uninstall logic for extensions

Index

Constants

This section is empty.

Variables

View Source
var ExtensionsDBDir = paths.RunPath

ExtensionsDBDir is the path to the extensions database, overridden in tests

View Source
var ExtensionsPackagesPath = paths.PackagesPath

ExtensionsPackagesPath is the base directory for extension files, overridden in tests

Functions

func DeletePackage

func DeletePackage(ctx context.Context, pkg string, isExperiment bool) (err error)

DeletePackage removes a package from the database.

func Install

func Install(ctx context.Context, downloader *oci.Downloader, url string, extensionsList []string, isExperiment bool, hooks ExtensionHooks, overrides map[string]ExtensionRegistry) (err error)

Install installs extensions for a package. If overrides is non-nil, extensions whose name appears as a key will be downloaded from the corresponding registry instead of the default one.

func Promote

func Promote(ctx context.Context, pkg string) (err error)

Promote promotes a package's extensions from experiment to stable.

func Remove

func Remove(ctx context.Context, pkg string, extensions []string, isExperiment bool, hooks ExtensionHooks) (err error)

Remove removes extensions for a package.

func RemoveAll

func RemoveAll(ctx context.Context, pkg string, isExperiment bool, hooks ExtensionHooks) (err error)

RemoveAll removes all extensions for a package.

func Restore

func Restore(ctx context.Context, downloader *oci.Downloader, pkg string, downloadURL string, saveDir string, isExperiment bool, hooks ExtensionHooks, overrides map[string]ExtensionRegistry) (err error)

Restore restores the extensions after a package upgrade

func Save

func Save(ctx context.Context, pkg string, saveDir string, isExperiment bool) (err error)

Save saves the extensions for a package upgrade

func SetPackage

func SetPackage(ctx context.Context, pkg string, version string, isExperiment bool) (err error)

SetPackage sets the version of a package in the database.

Types

type ExtensionHooks

type ExtensionHooks interface {
	PreInstallExtension(ctx context.Context, pkg string, extension string) error
	PreRemoveExtension(ctx context.Context, pkg string, extension string) error
	PostInstallExtension(ctx context.Context, pkg string, extension string, isExperiment bool) error
}

ExtensionHooks is the interface for the extension hooks.

type ExtensionRegistry added in v0.78.0

type ExtensionRegistry struct {
	URL      string
	Auth     string
	Username string
	Password string
}

ExtensionRegistry holds per-extension registry override settings.

Jump to

Keyboard shortcuts

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