extensions

package
v1.0.0-rc.79 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractManifest

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

func IsRemoteExtension

func IsRemoteExtension(origin string) bool

func SHA1

func SHA1(input string) string

Types

type Config

type Config struct {
	Origin      string            `json:"origin,omitempty"`
	Preferences types.Preferences `json:"preferences,omitempty"`
	Items       []types.RootItem  `json:"items,omitempty"`
	Hooks       Hooks             `json:"hooks,omitempty"`
}

func (Config) Entrypoint

func (c Config) Entrypoint() (string, error)

func (Config) ExtensionDir

func (c Config) ExtensionDir() string

func (*Config) UnmarshalJSON

func (e *Config) UnmarshalJSON(b []byte) error

type Extension

type Extension struct {
	Manifest   types.Manifest
	Entrypoint string `json:"entrypoint"`
	Config     Config `json:"config"`
}

func InstallExtension

func InstallExtension(config Config) (Extension, error)

func LoadExtension

func LoadExtension(config Config) (Extension, error)

func UpgradeExtension

func UpgradeExtension(config Config) (Extension, error)

func (Extension) CheckRequirements

func (ext Extension) CheckRequirements() error

func (Extension) Cmd

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

func (Extension) CmdContext

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

func (Extension) Command

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

func (Extension) Output

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

func (Extension) Root

func (e Extension) Root() []types.RootItem

func (Extension) Run

func (e Extension) Run(input types.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 Hooks

type Hooks struct {
	Install string `json:"install,omitempty"`
	Upgrade string `json:"upgrade,omitempty"`
}

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