publish

package
v0.90.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package publish implements plugin and plugin api publishing related function

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishPlugins

func PublishPlugins(pm *Metadata) error

PublishPlugins publishes the plugin based on provided metadata This function is responsible for auto-detecting the available plugin versions as well as os-arch and publishing artifacts to correct discovery and distribution based on the publisher type

Types

type LocalPublisher

type LocalPublisher struct {
	LocalDistributionPath string
}

LocalPublisher defines local publisher configuration

func (*LocalPublisher) PublishDiscovery

func (l *LocalPublisher) PublishDiscovery() error

PublishDiscovery publishes the CLIPlugin resources YAML to a local discovery directory

func (*LocalPublisher) PublishPlugin

func (l *LocalPublisher) PublishPlugin(sourcePath, version, os, arch, plugin string) (string, error)

PublishPlugin publishes plugin binaries to local distribution directory

func (*LocalPublisher) Type

func (l *LocalPublisher) Type() string

Type returns type of publisher

type Metadata

type Metadata struct {
	Plugins            []string
	InputArtifactDir   string
	OSArch             []string
	RecommendedVersion string
	LocalDiscoveryPath string
	PublisherInterface Publisher
}

Metadata defines metadata required for plugins publishing

type OCIPublisher

type OCIPublisher struct {
	OCIDiscoveryImage              string
	OCIDistributionImageRepository string

	LocalDiscoveryPath string
}

OCIPublisher defines OCI publisher configuration

func (*OCIPublisher) PublishDiscovery

func (o *OCIPublisher) PublishDiscovery() error

PublishDiscovery publishes the CLIPlugin resources YAML to a OCI based discovery container image

func (*OCIPublisher) PublishPlugin

func (o *OCIPublisher) PublishPlugin(sourcePath, version, os, arch, plugin string) (string, error)

PublishPlugin publishes plugin binaries to OCI based distribution directory

func (*OCIPublisher) Type

func (o *OCIPublisher) Type() string

Type returns type of publisher

type Publisher

type Publisher interface {
	// PublishPlugin publishes plugin binaries to distribution
	PublishPlugin(version, os, arch, plugin, sourcePath string) (string, error)
	// PublishDiscovery publishes the CLIPlugin resources YAML to a discovery
	PublishDiscovery() error
	// Type returns type of publisher (local, oci)
	Type() string
}

Publisher is an interface to publish plugin and CLIPlugin resource files to discovery

func NewLocalPublisher

func NewLocalPublisher(localDistributionPath string) (Publisher, error)

NewLocalPublisher create new local publisher

func NewOCIPublisher

func NewOCIPublisher(
	ociDiscoveryImage,
	ociDistributionImageRepository,
	localDiscoveryPath string) (Publisher, error)

NewOCIPublisher create new OCI based publisher

Jump to

Keyboard shortcuts

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