api

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Database database.Database
	Handler  http.Handler
	Logger   slog.Logger
}

func New

func New(options *Options) *API

New creates a new API server.

type Options

type Options struct {
	Database database.Database
	Logger   slog.Logger
	// Set to <0 to disable.
	RateLimit int
	Storage   storage.Storage
}

type QueryRequest

type QueryRequest struct {
	Filters []database.Filter `json:"filters"`
	Flags   database.Flag     `json:"flags"`
}

QueryRequest implements an untyped object. It is the data sent to the API to query for extensions. https://github.com/microsoft/vscode/blob/a69f95fdf3dc27511517eef5ff62b21c7a418015/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L338-L342

type QueryResponse

type QueryResponse struct {
	Results []QueryResult `json:"results"`
}

QueryResponse implements IRawGalleryQueryResult. This is the response sent to extension queries. https://github.com/microsoft/vscode/blob/29234f0219bdbf649d6107b18651a1038d6357ac/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L81-L92

type QueryResult

type QueryResult struct {
	Extensions []*database.Extension `json:"extensions"`
	Metadata   []ResultMetadata      `json:"resultMetadata"`
}

QueryResult implements IRawGalleryQueryResult.results. https://github.com/microsoft/vscode/blob/29234f0219bdbf649d6107b18651a1038d6357ac/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L82-L91

type ResultMetadata

type ResultMetadata struct {
	Type  string               `json:"metadataType"`
	Items []ResultMetadataItem `json:"metadataItems"`
}

ResultMetadata implements IRawGalleryQueryResult.resultMetadata. https://github.com/microsoft/vscode/blob/29234f0219bdbf649d6107b18651a1038d6357ac/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L84-L90

type ResultMetadataItem

type ResultMetadataItem struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

ResultMetadataItem implements IRawGalleryQueryResult.metadataItems. https://github.com/microsoft/vscode/blob/29234f0219bdbf649d6107b18651a1038d6357ac/src/vs/platform/extensionManagement/common/extensionGalleryService.ts#L86-L89

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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