cache

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 35 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 cache implements the plugin cache that contains all loaded plugins. It keeps the metadata for the various discovered plugins and provides a Go abstraction to call the appropriate commands.

Index

Constants

This section is empty.

Variables

View Source
var DirectoryCache = &pluginDirCache{
	directories: map[string]PluginDir{},
}

Functions

func Exec

func Exec(execpath string, config json.RawMessage, r io.Reader, w io.Writer, args ...string) ([]byte, error)

func GetCachedPluginInfo

func GetCachedPluginInfo(dir string, name string) (*descriptor.Descriptor, error)

func GetPluginInfo

func GetPluginInfo(execpath string) (*descriptor.Descriptor, error)

func RemoveFile

func RemoveFile(file string) error

func RemovePluginSource

func RemovePluginSource(dir string, name string) error

func SetPluginSourceInfo

func SetPluginSourceInfo(dir string, cv ocm.ComponentVersionAccess, rsc, name string) error

Types

type ConstraintRegistry

type ConstraintRegistry[T any, K registry.Key[K]] struct {
	// contains filtered or unexported fields
}

func NewConstraintRegistry

func NewConstraintRegistry[T descriptor.Element[K], K registry.Key[K]](list []T) *ConstraintRegistry[T, K]

func (*ConstraintRegistry[T, K]) Lookup

func (r *ConstraintRegistry[T, K]) Lookup(key K) []*T

func (*ConstraintRegistry[T, K]) LookupFor

func (r *ConstraintRegistry[T, K]) LookupFor(name string, key K) []*T

func (*ConstraintRegistry[T, K]) LookupKeys

func (r *ConstraintRegistry[T, K]) LookupKeys(key K) set.Set[K]

func (*ConstraintRegistry[T, K]) LookupKeysFor

func (r *ConstraintRegistry[T, K]) LookupKeysFor(name string, key K) set.Set[K]

type Plugin

type Plugin = *pluginImpl

func NewPlugin

func NewPlugin(name string, path string, desc *descriptor.Descriptor, errmsg string) Plugin

type PluginDir

type PluginDir = *pluginDirImpl

func Get

func Get(path string) PluginDir

func NewDir

func NewDir(path string) PluginDir

type PluginDirCache

type PluginDirCache = *pluginDirCache

type PluginInfo

type PluginInfo struct {
	Size       int64                  `json:"size,omitempty"`
	ModTime    time.Time              `json:"modtime,omitempty"`
	Descriptor *descriptor.Descriptor `json:"descriptor,omitempty"`
}

type PluginInstallationInfo

type PluginInstallationInfo struct {
	PluginSourceInfo `json:",inline"`
	PluginInfo       *PluginInfo `json:"info,omitempty"`
}

func (*PluginInstallationInfo) HasPluginInfo

func (p *PluginInstallationInfo) HasPluginInfo() bool

func (*PluginInstallationInfo) HasSourceInfo

func (p *PluginInstallationInfo) HasSourceInfo() bool

func (*PluginInstallationInfo) IsValidPluginInfo

func (p *PluginInstallationInfo) IsValidPluginInfo(execpath string) bool

func (*PluginInstallationInfo) UpdatePluginInfo

func (p *PluginInstallationInfo) UpdatePluginInfo(execpath string) (bool, error)

type PluginSourceInfo

type PluginSourceInfo struct {
	Repository *cpi.GenericRepositorySpec `json:"repository,omitempty"`
	Component  string                     `json:"component,omitempty"`
	Version    string                     `json:"version,omitempty"`
	Resource   string                     `json:"resource,omitempty"`
}

func (*PluginSourceInfo) GetDescription

func (p *PluginSourceInfo) GetDescription() string

func (*PluginSourceInfo) HasSourceInfo

func (p *PluginSourceInfo) HasSourceInfo() bool

type PluginUpdater

type PluginUpdater struct {
	Context     ocm.Context
	Force       bool
	RemoveMode  bool
	UpdateMode  bool
	Describe    bool
	Constraints []*semver.Constraints

	Current string
	Printer common.Printer
}

func NewPluginUpdater

func NewPluginUpdater(ctx ocm.ContextProvider, printer common.Printer) *PluginUpdater

func (*PluginUpdater) DownloadFromRepo

func (o *PluginUpdater) DownloadFromRepo(session ocm.Session, repo ocm.Repository, ref, name string) error

func (*PluginUpdater) DownloadRef

func (o *PluginUpdater) DownloadRef(session ocm.Session, ref string, name string) error

func (*PluginUpdater) Remove

func (o *PluginUpdater) Remove(session ocm.Session, name string) error

func (*PluginUpdater) Update

func (o *PluginUpdater) Update(session ocm.Session, name string) error

Jump to

Keyboard shortcuts

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