discovery

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

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

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

func NewGCPDiscovery(bucket, manifestPath, name string) Discovery

NewGCPDiscovery returns a new GCP bucket repository.

func NewKubernetesDiscovery added in v0.11.0

func NewKubernetesDiscovery(name, kubeconfigPath, kubecontext string) Discovery

NewKubernetesDiscovery returns a new kubernetes repository

func NewLocalDiscovery

func NewLocalDiscovery(name, localPath string) Discovery

NewLocalDiscovery returns a new local repository. If provided localPath is not an absolute path search under `xdg.ConfigHome/tanzu-plugin/discovery` directory

func NewOCIDiscovery

func NewOCIDiscovery(name, image string) Discovery

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.

func (*GCPDiscovery) Name

func (g *GCPDiscovery) Name() string

Name of the repository.

func (*GCPDiscovery) Type

func (g *GCPDiscovery) Type() string

Type of the discovery.

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.

func (*LocalDiscovery) Name

func (l *LocalDiscovery) Name() string

Name of the repository.

func (*LocalDiscovery) Type

func (l *LocalDiscovery) Type() string

Type of the 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.

func (*OCIDiscovery) Name

func (od *OCIDiscovery) Name() string

Name of the repository.

func (*OCIDiscovery) Type

func (od *OCIDiscovery) Type() string

Type of the discovery.

Jump to

Keyboard shortcuts

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