extensionhost

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package extensionhost owns native extension discovery, registration and files. It deliberately has no dependency on the GUI or the client package.

Index

Constants

View Source
const (
	StartupTimeout   = 5 * time.Second
	MaxExtensions    = 64
	MaxResourceBytes = 64 << 20
	MaxFileBytes     = 32 << 20
	MaxPackageBytes  = 256 << 20
	MaxPackageFiles  = 4096
)

Variables

This section is empty.

Functions

func Directory

func Directory() (string, error)

func Open

func Open(root *os.Root, directory string, manifest Manifest, stderr io.Writer) (io.ReadWriteCloser, error)

func ReadResource

func ReadResource(root *os.Root, name string, limit int64) ([]byte, error)

func ValidID

func ValidID(id string) bool

func ValidResourcePath

func ValidResourcePath(name string, resource bool) bool

Types

type Installed

type Installed = protocol.ExtensionInfo

func Inspect

func Inspect(directory, id string) (Installed, error)

func List

func List(directory string) ([]Installed, error)

List reads metadata without executing extensions, including disabled and broken installations so that users can inspect and remove them.

func SetDisabled

func SetDisabled(ctx context.Context, directory, id string, disabled bool) (Installed, error)

type Manifest

type Manifest = protocol.ExtensionManifest

The shared manifest and metadata are also the wire-domain types.

type Registration

type Registration struct {
	Info          Installed
	Diagnostics   string
	Contributions peb.Contributions
}

func Register

func Register(ctx context.Context, directory, id string, enable bool) (Registration, error)

Register probes a package on the server. Appearance resources are interpreted by the GUI before an installation or enable transaction can be committed.

type Upload

type Upload struct {
	Directory string
	// contains filtered or unexported fields
}

Upload retains one open file and accepts ordered chunks. The containing connection serializes its use and owns cleanup, including abandoned uploads.

func Begin

func Begin(directory string) (*Upload, error)

func (*Upload) Close

func (u *Upload) Close()

func (*Upload) Prepare

func (u *Upload) Prepare(ctx context.Context) (Registration, error)

func (*Upload) Publish

func (u *Upload) Publish(directory, id string) (string, error)

func (*Upload) Write

func (u *Upload) Write(name string, offset uint64, mode uint32, final bool, data []byte) error

Jump to

Keyboard shortcuts

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