Documentation
¶
Index ¶
- Variables
- func ConvertExtensionToManifest(ext Extension, version string) *storage.VSIXManifest
- func ConvertExtensionToManifestBytes(t *testing.T, ext Extension, version string) []byte
- func CreateVSIX(t *testing.T, manifestBytes []byte, packageJSONBytes []byte) []byte
- func CreateVSIXFromExtension(t *testing.T, ext Extension) []byte
- func CreateVSIXFromManifest(t *testing.T, manifest *storage.VSIXManifest) []byte
- func CreateVSIXFromPackageJSON(t *testing.T, packageJSON *storage.VSIXPackageJSON) []byte
- type Extension
- type MockDB
- type MockStorage
- func (s *MockStorage) AddExtension(ctx context.Context, manifest *storage.VSIXManifest, vsix []byte) (string, error)
- func (s *MockStorage) FileServer() http.Handler
- func (s *MockStorage) Manifest(ctx context.Context, publisher, name, version string) (*storage.VSIXManifest, error)
- func (s *MockStorage) RemoveExtension(ctx context.Context, publisher, name, version string) error
- func (s *MockStorage) Versions(ctx context.Context, publisher, name string) ([]string, error)
- func (s *MockStorage) WalkExtensions(ctx context.Context, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Extensions = []Extension{ { Publisher: "foo", Name: "zany", Description: "foo bar baz qux", Tags: "tag1", Categories: "category1", Files: []storage.VSIXAsset{ {Type: "Microsoft.VisualStudio.Services.Icons.Default", Path: "icon.png", Addressable: "true"}, {Type: "Unaddressable", Path: "unaddressable.ext", Addressable: "false"}, }, Properties: []storage.VSIXProperty{ { ID: "Microsoft.VisualStudio.Code.ExtensionPack", Value: "a.b,b.c", }, { ID: "Microsoft.VisualStudio.Code.ExtensionDependencies", Value: "d.e", }, }, Versions: []string{"1.0.0", "2.0.0", "3.0.0", "1.5.2", "2.2.2"}, LatestVersion: "3.0.0", Dependencies: []string{"d.e"}, Pack: []string{"a.b", "b.c"}, }, { Publisher: "foo", Name: "buz", Description: "quix baz bar buz sitting", Tags: "tag2", Categories: "category2", Properties: []storage.VSIXProperty{ { ID: "Microsoft.VisualStudio.Code.ExtensionPack", Value: "", }, { ID: "Microsoft.VisualStudio.Code.ExtensionDependencies", Value: "", }, }, Versions: []string{"version1"}, LatestVersion: "version1", }, { Publisher: "bar", Name: "squigly", Description: "squigly foo and more foo bar baz", Tags: "tag1,tag2", Categories: "category1,category2", Versions: []string{"version1", "version2"}, LatestVersion: "version2", }, { Publisher: "fred", Name: "thud", Description: "frobbles the frobnozzle", Tags: "tag3,tag4,tag5", Categories: "category1", Versions: []string{"version1", "version2"}, LatestVersion: "version2", }, { Publisher: "qqqqqqqqqqq", Name: "qqqqq", Description: "qqqqqqqqqqqqqqqqqqq", Tags: "qq,qqq,qqqq", Categories: "q", Versions: []string{"qqq", "q"}, LatestVersion: "qqq", }, }
Functions ¶
func ConvertExtensionToManifest ¶
func ConvertExtensionToManifest(ext Extension, version string) *storage.VSIXManifest
func ConvertExtensionToManifestBytes ¶ added in v1.2.1
func CreateVSIX ¶ added in v1.2.0
createVSIX returns the bytes for a VSIX file containing the provided raw manifest and package.json bytes (if not nil) and an icon.
func CreateVSIXFromExtension ¶ added in v1.2.0
CreateVSIXFromExtension returns the bytes for a VSIX file containing the manifest for the provided test extension and an icon.
func CreateVSIXFromManifest ¶ added in v1.2.0
func CreateVSIXFromManifest(t *testing.T, manifest *storage.VSIXManifest) []byte
CreateVSIXFromManifest returns the bytes for a VSIX file containing the provided manifest and an icon.
func CreateVSIXFromPackageJSON ¶ added in v1.2.0
func CreateVSIXFromPackageJSON(t *testing.T, packageJSON *storage.VSIXPackageJSON) []byte
Types ¶
type MockDB ¶ added in v1.2.0
type MockDB struct {
// contains filtered or unexported fields
}
MockDB implements database.Database for tests.
func (*MockDB) GetExtensionAssetPath ¶ added in v1.2.0
type MockStorage ¶ added in v1.2.0
type MockStorage struct{}
MockStorage implements storage.Storage for tests.
func NewMockStorage ¶ added in v1.2.0
func NewMockStorage() *MockStorage
func (*MockStorage) AddExtension ¶ added in v1.2.0
func (s *MockStorage) AddExtension(ctx context.Context, manifest *storage.VSIXManifest, vsix []byte) (string, error)
func (*MockStorage) FileServer ¶ added in v1.2.0
func (s *MockStorage) FileServer() http.Handler
func (*MockStorage) Manifest ¶ added in v1.2.0
func (s *MockStorage) Manifest(ctx context.Context, publisher, name, version string) (*storage.VSIXManifest, error)
func (*MockStorage) RemoveExtension ¶ added in v1.2.0
func (s *MockStorage) RemoveExtension(ctx context.Context, publisher, name, version string) error
func (*MockStorage) WalkExtensions ¶ added in v1.2.0
func (s *MockStorage) WalkExtensions(ctx context.Context, fn func(manifest *storage.VSIXManifest, versions []string) error) error
Click to show internal directories.
Click to hide internal directories.