cache

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

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 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 WritePluginSource

func WritePluginSource(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) generics.Set[K]

func (*ConstraintRegistry[T, K]) LookupKeysFor

func (r *ConstraintRegistry[T, K]) LookupKeysFor(name string, key K) generics.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 PluginSource

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

func ReadPluginSource

func ReadPluginSource(dir string, name string) (*PluginSource, error)

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) SetupCurrent

func (o *PluginUpdater) SetupCurrent(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