Documentation ¶
Overview ¶
Package discovery is implements discovery interface for plugin discovery Discovery is the interface to fetch the list of available plugins, their supported versions and how to download them either stand-alone or scoped to a server. A separate interface for discovery helps to decouple discovery (which is usually tied to a server or user identity) from distribution (which can be shared).
Index ¶
- func CheckDiscoveryName(ds configv1alpha1.PluginDiscovery, dn string) bool
- func CompareDiscoverySource(ds1, ds2 configv1alpha1.PluginDiscovery, dsType string) bool
- func DiscoveredFromK8sV1alpha1(p *cliv1alpha1.CLIPlugin) plugin.Discovered
- type Discovery
- func CreateDiscoveryFromV1alpha1(pd v1alpha1.PluginDiscovery) (Discovery, error)
- func NewGCPDiscovery(bucket, manifestPath, name string) Discovery
- func NewKubernetesDiscovery(name, kubeconfigPath, kubecontext string) Discovery
- func NewLocalDiscovery(name, localPath string) Discovery
- func NewOCIDiscovery(name, image string) Discovery
- type GCPDiscovery
- type KubernetesDiscovery
- func (k *KubernetesDiscovery) Describe(name string) (p plugin.Discovered, err error)
- func (k *KubernetesDiscovery) List() ([]plugin.Discovered, error)
- func (k *KubernetesDiscovery) Manifest() ([]plugin.Discovered, error)
- func (k *KubernetesDiscovery) Name() string
- func (k *KubernetesDiscovery) Type() string
- type LocalDiscovery
- type OCIDiscovery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDiscoveryName ¶ added in v0.11.0
func CheckDiscoveryName(ds configv1alpha1.PluginDiscovery, dn string) bool
CheckDiscoveryName returns true if discovery name exists else return false
func CompareDiscoverySource ¶ added in v0.11.0
func CompareDiscoverySource(ds1, ds2 configv1alpha1.PluginDiscovery, dsType string) bool
CompareDiscoverySource returns true if both discovery source are same for the given type
func DiscoveredFromK8sV1alpha1 ¶
func DiscoveredFromK8sV1alpha1(p *cliv1alpha1.CLIPlugin) plugin.Discovered
DiscoveredFromK8sV1alpha1 returns discovered plugin object from k8sV1alpha1
Types ¶
type Discovery ¶
type Discovery interface { // Name of the repository. Name() string // List available plugins. List() ([]plugin.Discovered, error) // Describe a plugin. Describe(name string) (plugin.Discovered, error) // Type returns type of discovery. Type() string }
Discovery is the interface to fetch the list of available plugins
func CreateDiscoveryFromV1alpha1 ¶
func CreateDiscoveryFromV1alpha1(pd v1alpha1.PluginDiscovery) (Discovery, error)
CreateDiscoveryFromV1alpha1 creates discovery interface from v1alpha1 API
func NewGCPDiscovery ¶
NewGCPDiscovery returns a new GCP bucket repository.
func NewKubernetesDiscovery ¶ added in v0.11.0
NewKubernetesDiscovery returns a new kubernetes repository
func NewLocalDiscovery ¶
NewLocalDiscovery returns a new local repository. If provided localPath is not an absolute path search under `xdg.ConfigHome/tanzu-plugin/discovery` directory
func NewOCIDiscovery ¶
NewOCIDiscovery returns a new local repository.
type GCPDiscovery ¶
type GCPDiscovery struct {
// contains filtered or unexported fields
}
GCPDiscovery is an artifact discovery endpoing utilizing a GCP bucket.
func (*GCPDiscovery) Describe ¶
func (g *GCPDiscovery) Describe(name string) (p plugin.Discovered, err error)
Describe a plugin.
func (*GCPDiscovery) List ¶
func (g *GCPDiscovery) List() (plugins []plugin.Discovered, err error)
List available plugins.
type KubernetesDiscovery ¶ added in v0.11.0
type KubernetesDiscovery struct {
// contains filtered or unexported fields
}
KubernetesDiscovery is an artifact discovery utilizing CLIPlugin API in kubernetes cluster
func (*KubernetesDiscovery) Describe ¶ added in v0.11.0
func (k *KubernetesDiscovery) Describe(name string) (p plugin.Discovered, err error)
Describe a plugin.
func (*KubernetesDiscovery) List ¶ added in v0.11.0
func (k *KubernetesDiscovery) List() ([]plugin.Discovered, error)
List available plugins.
func (*KubernetesDiscovery) Manifest ¶ added in v0.11.0
func (k *KubernetesDiscovery) Manifest() ([]plugin.Discovered, error)
Manifest returns the manifest for a local repository.
func (*KubernetesDiscovery) Name ¶ added in v0.11.0
func (k *KubernetesDiscovery) Name() string
Name of the repository.
func (*KubernetesDiscovery) Type ¶ added in v0.11.0
func (k *KubernetesDiscovery) Type() string
Type of the repository.
type LocalDiscovery ¶
type LocalDiscovery struct {
// contains filtered or unexported fields
}
LocalDiscovery is an artifact discovery endpoint utilizing a local host os.
func (*LocalDiscovery) Describe ¶
func (l *LocalDiscovery) Describe(name string) (p plugin.Discovered, err error)
Describe a plugin.
func (*LocalDiscovery) List ¶
func (l *LocalDiscovery) List() ([]plugin.Discovered, error)
List available plugins.
func (*LocalDiscovery) Manifest ¶
func (l *LocalDiscovery) Manifest() ([]plugin.Discovered, error)
Manifest returns the manifest for a local repository.
type OCIDiscovery ¶
type OCIDiscovery struct {
// contains filtered or unexported fields
}
OCIDiscovery is an artifact discovery endpoint utilizing OCI image
func (*OCIDiscovery) Describe ¶
func (od *OCIDiscovery) Describe(name string) (p plugin.Discovered, err error)
Describe a plugin.
func (*OCIDiscovery) List ¶
func (od *OCIDiscovery) List() (plugins []plugin.Discovered, err error)
List available plugins.
func (*OCIDiscovery) Manifest ¶ added in v0.11.0
func (od *OCIDiscovery) Manifest() ([]plugin.Discovered, error)
Manifest returns the manifest for a local repository.