Documentation
¶
Index ¶
- func ExtractZip(rawZip []byte, writer func(name string) (io.WriteCloser, error)) error
- func GetZipFileReader(rawZip []byte, filename string) (io.ReadCloser, error)
- func WalkZip(rawZip []byte, fn func(*zip.File) (bool, error)) (io.ReadCloser, error)
- type AssetType
- type Extension
- type Local
- func (s *Local) AddExtension(ctx context.Context, source string) (*Extension, error)
- func (s *Local) FileServer() http.Handler
- func (s *Local) Manifest(ctx context.Context, publisher, extension, version string) (*VSIXManifest, error)
- func (s *Local) RemoveExtension(ctx context.Context, id string, all bool) ([]string, error)
- func (s *Local) WalkExtensions(ctx context.Context, fn func(manifest *VSIXManifest, versions []string) error) error
- type PropertyType
- type Storage
- type VSIXAsset
- type VSIXAssets
- type VSIXIdentity
- type VSIXManifest
- type VSIXMetadata
- type VSIXProperties
- type VSIXProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractZip ¶
ExtractZip extracts a zip's files to the specified directory. The writer is expected to create any necessary directories and return a writer for writing a file.
func GetZipFileReader ¶
func GetZipFileReader(rawZip []byte, filename string) (io.ReadCloser, error)
GetZipFileReader returns a reader for a single file in a zip.
Types ¶
type AssetType ¶
type AssetType string
const (
VSIXAssetType AssetType = "Microsoft.VisualStudio.Services.VSIXPackage"
)
type Local ¶
Local implements Storage. It stores extensions locally on disk.
func (*Local) AddExtension ¶
func (*Local) FileServer ¶
func (*Local) RemoveExtension ¶
func (*Local) WalkExtensions ¶
type PropertyType ¶
type PropertyType string
const ( DependencyPropertyType PropertyType = "Microsoft.VisualStudio.Code.ExtensionDependencies" PackPropertyType PropertyType = "Microsoft.VisualStudio.Code.ExtensionPack" )
type Storage ¶
type Storage interface {
// AddExtension adds the extension found at the specified source by copying it
// into the extension storage directory and returns details about the added
// extension. The source may be an URI or a local file path.
AddExtension(ctx context.Context, source string) (*Extension, error)
// RemoveExtension removes the extension by id (publisher, name, and version)
// or all versions if all is true (in which case the id should omit the
// version) and returns the IDs removed.
RemoveExtension(ctx context.Context, name string, all bool) ([]string, error)
// FileServer provides a handler for fetching extension repository files from
// a client.
FileServer() http.Handler
// Manifest returns the manifest for the provided extension version.
Manifest(ctx context.Context, publisher, extension, version string) (*VSIXManifest, error)
// WalkExtensions applies a function over every extension providing the
// manifest for the latest version and a list of all available versions. If
// the function returns error the error is returned and the iteration aborted.
WalkExtensions(ctx context.Context, fn func(manifest *VSIXManifest, versions []string) error) error
}
TODO: Add Artifactory implementation of Storage.
type VSIXAsset ¶
type VSIXAsset struct {
Type AssetType `xml:",attr"`
Path string `xml:",attr"`
Addressable string `xml:",attr"`
}
VSIXAsset implements XMLManifest.PackageManifest.Assets.Asset. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L25
type VSIXAssets ¶
type VSIXAssets struct {
Asset []VSIXAsset
}
VSIXAssets implements XMLManifest.PackageManifest.Assets. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L25
type VSIXIdentity ¶
type VSIXIdentity struct {
// ID correlates to ExtensionName, *not* ExtensionID.
ID string `xml:"Id,attr"`
Version string `xml:",attr"`
Publisher string `xml:",attr"`
TargetPlatform string `xml:",attr"`
}
VSIXManifest implement XMLManifest.PackageManifest.Metadata.Identity. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L14
type VSIXManifest ¶
type VSIXManifest struct {
Metadata VSIXMetadata
Installation struct {
InstallationTarget struct {
ID string `xml:"Id,attr"`
}
}
Dependencies []string
Assets VSIXAssets
}
VSIXManifest implement XMLManifest.PackageManifest. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L9-L26
type VSIXMetadata ¶
type VSIXMetadata struct {
Description string
DisplayName string
Identity VSIXIdentity
Tags string
GalleryFlags string
License string
Icon string
Properties VSIXProperties
Categories string
}
VSIXManifest implement XMLManifest.PackageManifest.Metadata. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L11-L22
type VSIXProperties ¶
type VSIXProperties struct {
Property []VSIXProperty
}
VSIXProperties implements XMLManifest.PackageManifest.Metadata.Properties. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L19
type VSIXProperty ¶
type VSIXProperty struct {
ID PropertyType `xml:"Id,attr"`
Value string `xml:",attr"`
}
VSIXProperty implements XMLManifest.PackageManifest.Metadata.Properties.Property. https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L19