extensions

package
v0.0.0-...-235cf61 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnimplemented = errors.New("unimplemented")

ErrUnimplemented is returned when an extension is not implemented.

View Source
var Unknown = "unknown"

Unknown is returned when an extension is not found.

Functions

func DataDir

func DataDir() string

DataDir returns the data directory for the extension.

Types

type Extension

type Extension interface {
	// Name is the name of the extension
	Name() string
	// Path is the path to the extension
	Path() string
	// Owner is the owner of the extension
	Owner() string
	// Cmd is the command for the extension
	Cmd() *cobra.Command
}

Extension represents a single extension.

func Load

func Load(path string) (Extension, error)

Load loads an extension with the given path and returns an instance.

func Scan

func Scan(folder string) ([]Extension, error)

Scan is scanning a folder for extensions. Extensions start with "oci-" for the ocictl.

type Manager

type Manager interface {
	// Scan is scanning for extensions
	Scan(path string) error
	// ListExtensions lists all installed extensions
	ListExtensions() []Extension
	// EnableDryRunMode enables dry run mode
	EnableDryRunMode()
}

Manager manages a collection of extensions.

func NewManager

func NewManager() Manager

NewManager creates a new extension manager.

type UnimplementedExtension

type UnimplementedExtension struct{}

func (*UnimplementedExtension) Cmd

Cmd implements Extension.Cmd.

func (*UnimplementedExtension) Name

func (e *UnimplementedExtension) Name() string

Name implements Extension.Name.

func (*UnimplementedExtension) Owner

func (e *UnimplementedExtension) Owner() string

Owner implements Extension.Owner.

func (*UnimplementedExtension) Path

func (e *UnimplementedExtension) Path() string

Path implements Extension.Path.

Jump to

Keyboard shortcuts

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