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 ¶
- Variables
- func Exec(execpath string, config json.RawMessage, r io.Reader, w io.Writer, ...) ([]byte, error)
- func GetCachedPluginInfo(dir string, name string) (*descriptor.Descriptor, error)
- func GetPluginInfo(execpath string) (*descriptor.Descriptor, error)
- func RemoveFile(file string) error
- func RemovePluginSource(dir string, name string) error
- func SetPluginSourceInfo(dir string, cv ocm.ComponentVersionAccess, rsc, name string) error
- type ConstraintRegistry
- type Plugin
- type PluginDir
- type PluginDirCache
- type PluginInfo
- type PluginInstallationInfo
- type PluginSourceInfo
- type PluginUpdater
- func (o *PluginUpdater) DownloadFromRepo(session ocm.Session, repo ocm.Repository, ref, name string) error
- func (o *PluginUpdater) DownloadRef(session ocm.Session, ref string, name string) error
- func (o *PluginUpdater) Remove(session ocm.Session, name string) error
- func (o *PluginUpdater) Update(session ocm.Session, name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DirectoryCache = &pluginDirCache{ directories: map[string]PluginDir{}, }
Functions ¶
func GetCachedPluginInfo ¶ added in v0.12.0
func GetCachedPluginInfo(dir string, name string) (*descriptor.Descriptor, error)
func GetPluginInfo ¶
func GetPluginInfo(execpath string) (*descriptor.Descriptor, error)
func RemoveFile ¶
func RemovePluginSource ¶
func SetPluginSourceInfo ¶ added in v0.12.0
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 PluginDirCache ¶
type PluginDirCache = *pluginDirCache
type PluginInfo ¶ added in v0.12.0
type PluginInfo struct { Size int64 `json:"size,omitempty"` ModTime time.Time `json:"modtime,omitempty"` Descriptor *descriptor.Descriptor `json:"descriptor,omitempty"` }
type PluginInstallationInfo ¶ added in v0.12.0
type PluginInstallationInfo struct { PluginSourceInfo `json:",inline"` PluginInfo *PluginInfo `json:"info,omitempty"` }
func (*PluginInstallationInfo) HasPluginInfo ¶ added in v0.12.0
func (p *PluginInstallationInfo) HasPluginInfo() bool
func (*PluginInstallationInfo) HasSourceInfo ¶ added in v0.12.0
func (p *PluginInstallationInfo) HasSourceInfo() bool
func (*PluginInstallationInfo) IsValidPluginInfo ¶ added in v0.12.0
func (p *PluginInstallationInfo) IsValidPluginInfo(execpath string) bool
func (*PluginInstallationInfo) UpdatePluginInfo ¶ added in v0.12.0
func (p *PluginInstallationInfo) UpdatePluginInfo(execpath string) (bool, error)
type PluginSourceInfo ¶ added in v0.12.0
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 ¶ added in v0.12.0
func (p *PluginSourceInfo) GetDescription() string
func (*PluginSourceInfo) HasSourceInfo ¶ added in v0.12.0
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 ¶
Click to show internal directories.
Click to hide internal directories.