extension

package
v2.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommitNotFound = errors.New("commit not found")
View Source
var ErrLocalExtensionUpgrade = errors.New("local extensions can not be updated")
View Source
var ErrNoExtensionsInstalled = errors.New("no extensions installed")
View Source
var ErrPinnedExtensionUpgrade = errors.New("pinned extensions can not be updated")
View Source
var ErrReleaseNotFound = errors.New("release not found")
View Source
var ErrRepositoryNotFound = errors.New("repository not found")
View Source
var ErrUpToDate = errors.New("already up to date")
View Source
var ExtPrefix = "c8y-"

Functions

func HandleHTTPError

func HandleHTTPError(resp *http.Response) error

func NewCmdExtension

func NewCmdExtension(f *cmdutil.Factory) *cobra.Command

func RESTPrefix

func RESTPrefix(hostname string) string

Types

type AliasCollection

type AliasCollection struct {
	Name    string
	Aliases []extensions.Alias
}

type AliasExtension

type AliasExtension struct {
	Source      string `json:"-" yaml:"-"`
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Command     string `json:"command,omitempty" yaml:"command,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Shell       bool   `json:"shell" yaml:"shell"`
}

func (*AliasExtension) GetCommand

func (a *AliasExtension) GetCommand() string

func (*AliasExtension) GetDescription

func (a *AliasExtension) GetDescription() string

func (*AliasExtension) GetName

func (a *AliasExtension) GetName() string

func (*AliasExtension) IsShell

func (a *AliasExtension) IsShell() bool

type Command

type Command struct {
	// contains filtered or unexported fields
}

func (*Command) Command

func (c *Command) Command() string

func (*Command) Description

func (c *Command) Description() string

func (*Command) Name

func (c *Command) Name() string

type Extension

type Extension struct {
	// contains filtered or unexported fields
}

func (*Extension) Aliases

func (e *Extension) Aliases() ([]extensions.Alias, error)

Custom extension components

func (*Extension) Commands

func (e *Extension) Commands() ([]extensions.Command, error)

func (*Extension) CurrentVersion

func (e *Extension) CurrentVersion() string

func (*Extension) IsBinary

func (e *Extension) IsBinary() bool

func (*Extension) IsLocal

func (e *Extension) IsLocal() bool

func (*Extension) IsPinned

func (e *Extension) IsPinned() bool

func (*Extension) Name

func (e *Extension) Name() string

func (*Extension) Path

func (e *Extension) Path() string

func (*Extension) TemplatePath

func (e *Extension) TemplatePath() string

func (*Extension) URL

func (e *Extension) URL() string

func (*Extension) UpdateAvailable

func (e *Extension) UpdateAvailable() bool

func (*Extension) ViewPath

func (e *Extension) ViewPath() string

type ExtensionFile

type ExtensionFile struct {
	Aliases []AliasExtension `json:"aliases,omitempty" yaml:"aliases,omitempty"`
}

type ExtensionItemCollection

type ExtensionItemCollection struct {
	Items []ExtensionSource
}

func NewExtensionItemCollection

func NewExtensionItemCollection() *ExtensionItemCollection

func (*ExtensionItemCollection) Add

func (t *ExtensionItemCollection) Add(name string, paths []string)

func (*ExtensionItemCollection) AddSources

func (t *ExtensionItemCollection) AddSources(sources []ExtensionSource)

type ExtensionKind

type ExtensionKind int
const (
	GitKind ExtensionKind = iota
	BinaryKind
)

type ExtensionSource

type ExtensionSource struct {
	Name  string
	Paths []string
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(ios *iostreams.IOStreams, cfg *config.Config) *Manager

func (*Manager) Create

func (m *Manager) Create(name string, tmplType extensions.ExtTemplateType) error

func (*Manager) Dispatch

func (m *Manager) Dispatch(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, error)

func (*Manager) EnableDryRunMode

func (m *Manager) EnableDryRunMode()

func (*Manager) Execute

func (m *Manager) Execute(exe string, args []string, isBinary bool, stdin io.Reader, stdout, stderr io.Writer) (bool, error)

func (*Manager) Install

func (m *Manager) Install(repo ghrepo.Interface, name string, target string) error

Install installs an extension from repo, and pins to commitish if provided

func (*Manager) InstallLocal

func (m *Manager) InstallLocal(dir string, name string) error

func (*Manager) List

func (m *Manager) List() []extensions.Extension

func (*Manager) Remove

func (m *Manager) Remove(name string) error

func (*Manager) SetClient

func (m *Manager) SetClient(client *http.Client)

func (*Manager) SetConfig

func (m *Manager) SetConfig(cfg config.Config)

func (*Manager) Upgrade

func (m *Manager) Upgrade(name string, force bool) error

Jump to

Keyboard shortcuts

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