plugins

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: ISC Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const PLUGIN_API_VERSION = "v1.0.0"

Variables

View Source
var RecipeURL, _ = url.Parse("https://plugins.plakar.io/kloset/recipe/" + PLUGIN_API_VERSION + "/")

Functions

func GetStageFromVersion

func GetStageFromVersion(version string) string

func NewStdioConn

func NewStdioConn(stdin, stdout *os.File, cmd *exec.Cmd) net.Conn

func PackageCmp

func PackageCmp(a, b Package) int

func ParseManifestFile

func ParseManifestFile(path string, manifest *Manifest) error

func ParsePackageName

func ParsePackageName(name string, pkg *Package) error

Types

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

func (*Cache[T]) Get

func (c *Cache[T]) Get() (T, error)

type Integration

type Integration struct {
	Id            string           `json:"id"`
	Name          string           `json:"name"`
	DisplayName   string           `json:"display_name"`
	Description   string           `json:"description"`
	Homepage      string           `json:"homepage"`
	Repository    string           `json:"repository"`
	License       string           `json:"license"`
	Tags          []string         `json:"tags"`
	APIVersion    string           `json:"api_version"`
	LatestVersion string           `json:"latest_version"`
	Stage         string           `json:"stage"`
	Types         IntegrationTypes `json:"types"`

	Documentation string `json:"documentation"` // README.md
	Icon          string `json:"icon"`          // assets/icon.{png,svg}
	Featured      string `json:"featured"`      // assets/featured.{png,svg}

	Installation IntegrationInstallation `json:"installation"`
}

type IntegrationFilter

type IntegrationFilter struct {
	Type   string
	Tag    string
	Status string
}

type IntegrationIndex

type IntegrationIndex struct {
	Integrations []Integration `json:"integrations"`
}

type IntegrationInstallation

type IntegrationInstallation struct {
	Status    string `json:"status"`
	Version   string `json:"version,omitempty"`
	Available bool   `json:"available"`
}

type IntegrationTypes

type IntegrationTypes struct {
	Storage     bool `json:"storage"`
	Source      bool `json:"source"`
	Destination bool `json:"destination"`
}

type Manager

type Manager struct {
	ApiVersion string
	Os         string
	Arch       string

	PluginsDir string // Where plugins are installed
	CacheDir   string // where plugins are decompressed

	PackagesUrl string // Where prebuilt packages are retrieved from
	// contains filtered or unexported fields
}

func NewManager

func NewManager(pluginsDir, cacheDir string) *Manager

func (*Manager) FindAvailablePackage

func (mgr *Manager) FindAvailablePackage(name string) (Package, error)

func (*Manager) FindInstalledPackage

func (mgr *Manager) FindInstalledPackage(name string) (Package, error)

func (*Manager) ForceReloadPlugins

func (mgr *Manager) ForceReloadPlugins(ctx *kcontext.KContext) error

func (*Manager) InstallPackage

func (mgr *Manager) InstallPackage(ctx *kcontext.KContext, pkg Package, filename string) error

func (*Manager) IntegrationAsPackage

func (mgr *Manager) IntegrationAsPackage(int *Integration) Package

func (*Manager) IsAvailable

func (mgr *Manager) IsAvailable(pkg Package) (bool, error)

func (*Manager) IsInstalled

func (mgr *Manager) IsInstalled(pkg Package) (bool, Package, error)

func (*Manager) ListAvailablePackages

func (mgr *Manager) ListAvailablePackages() ([]Package, error)

func (*Manager) ListInstalledPackages

func (mgr *Manager) ListInstalledPackages() ([]Package, error)

func (*Manager) ListIntegrations

func (mgr *Manager) ListIntegrations(filter IntegrationFilter) ([]Integration, error)

func (*Manager) LoadPlugins

func (mgr *Manager) LoadPlugins(ctx *kcontext.KContext) error

func (*Manager) PackageUrl

func (mgr *Manager) PackageUrl(pkg Package) string

func (*Manager) PluginCache

func (mgr *Manager) PluginCache(pkg Package) string

func (*Manager) PluginFile

func (mgr *Manager) PluginFile(pkg Package) string

func (*Manager) ReloadPlugins

func (mgr *Manager) ReloadPlugins(ctx *kcontext.KContext) error

func (*Manager) UninstallPackage

func (mgr *Manager) UninstallPackage(ctx *kcontext.KContext, pkg Package) error

func (*Manager) UnloadPlugins

func (mgr *Manager) UnloadPlugins(ctx *kcontext.KContext)

type Manifest

type Manifest struct {
	Name        string   `yaml:"name"`
	DisplayName string   `yaml:"display_name"`
	Description string   `yaml:"description"`
	Homepage    string   `yaml:"homepage"`
	License     string   `yaml:"license"`
	Tags        []string `yaml:"tags"`
	APIVersion  string   `yaml:"api_version"`
	Version     string   `yaml:"version"`

	Connectors []struct {
		Type          string   `yaml:"type"`
		Protocols     []string `yaml:"protocols"`
		LocationFlags []string `yaml:"location_flags"`
		Executable    string   `yaml:"executable"`
		Args          []string `yaml:"args"`
		ExtraFiles    []string `yaml:"extra_files"`
	} `yaml:"connectors"`
}

type Package

type Package struct {
	Name    string
	Version string
	Os      string
	Arch    string
}

func (Package) PkgName

func (pkg Package) PkgName() string

func (Package) PkgNameAndVersion

func (pkg Package) PkgNameAndVersion() string

func (Package) PluginName

func (pkg Package) PluginName() string

func (Package) Validate

func (pkg Package) Validate() error

type Plugin

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

func (*Plugin) SetUp

func (plugin *Plugin) SetUp(ctx *kcontext.KContext, pluginFile, pluginName, cacheDir string) error

func (*Plugin) TearDown

func (plugin *Plugin) TearDown(ctx *kcontext.KContext)

type Recipe

type Recipe struct {
	Name       string `yaml:"name"`
	Version    string `yaml:"version"`
	Repository string `yaml:"repository"`
	Checksum   string `yaml:"checksum"`
}

func (*Recipe) Parse

func (recipe *Recipe) Parse(rd io.Reader) error

func (*Recipe) PkgName

func (recipe *Recipe) PkgName() string

type StdioConn

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

func (*StdioConn) Close

func (c *StdioConn) Close() (ret error)

func (*StdioConn) LocalAddr

func (c *StdioConn) LocalAddr() net.Addr

func (*StdioConn) Read

func (c *StdioConn) Read(b []byte) (int, error)

func (*StdioConn) RemoteAddr

func (c *StdioConn) RemoteAddr() net.Addr

func (*StdioConn) SetDeadline

func (c *StdioConn) SetDeadline(t time.Time) error

func (*StdioConn) SetReadDeadline

func (c *StdioConn) SetReadDeadline(t time.Time) error

func (*StdioConn) SetWriteDeadline

func (c *StdioConn) SetWriteDeadline(t time.Time) error

func (*StdioConn) Write

func (c *StdioConn) Write(b []byte) (int, error)

type TearDownFunc

type TearDownFunc func() error

Jump to

Keyboard shortcuts

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