extensions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadEntrypoint

func DownloadEntrypoint(origin string, target string) error

func ExtractManifest

func ExtractManifest(entrypoint string) (sunbeam.Manifest, error)

func Hash

func Hash(origin string) (string, error)

func IsRemote

func IsRemote(origin string) bool

func LoadEntrypoint

func LoadEntrypoint(origin string, extensionDir string) (string, error)

func Upgrade

func Upgrade(extensionConfig config.ExtensionConfig) error

Types

type Extension

type Extension struct {
	Manifest   sunbeam.Manifest
	Entrypoint string `json:"entrypoint"`
}

func LoadExtension

func LoadExtension(origin string) (Extension, error)

func (Extension) Cmd

func (e Extension) Cmd(input sunbeam.Payload) (*exec.Cmd, error)

func (Extension) CmdContext

func (e Extension) CmdContext(ctx context.Context, input sunbeam.Payload) (*exec.Cmd, error)

func (Extension) Command

func (e Extension) Command(name string) (sunbeam.CommandSpec, bool)

func (Extension) Output

func (ext Extension) Output(input sunbeam.Payload) ([]byte, error)

func (Extension) RootCommands

func (e Extension) RootCommands() []sunbeam.CommandSpec

func (Extension) Run

func (e Extension) Run(input sunbeam.Payload) error

type ExtensionMap

type ExtensionMap map[string]Extension

func (ExtensionMap) List

func (e ExtensionMap) List() []Extension

type ExtensionType

type ExtensionType string
const (
	ExtensionTypeLocal ExtensionType = "local"
	ExtensionTypeHttp  ExtensionType = "http"
)

type Metadata

type Metadata struct {
	Type       ExtensionType `json:"type"`
	Origin     string        `json:"origin"`
	Entrypoint string        `json:"entrypoint"`
}

type Preferences

type Preferences map[string]any

Jump to

Keyboard shortcuts

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