Documentation
¶
Overview ¶
Package pluginwire is the wire contract for the private plugin Marketplace.
It is the single definition of the shapes the server writes and the CLI reads, so a field can never mean one thing on one side and something else on the other. The entities themselves come from internal/core/plugin — what is here is the envelope around them, the paths, and the one header a download carries.
Mirrors the design in docs/design/plugin-marketplace.md section 7.6.
Index ¶
Constants ¶
const ( // CatalogPath lists the browsable catalog. CatalogPath = "/api/plugins" // PluginPath is one entry and everything published under it. PluginPath = "/api/plugins/%s" // DownloadPath streams one release's bytes. DownloadPath = "/api/plugins/%s/releases/%s/download" // AdminCatalogPath lists every entry, archived included, and creates one. AdminCatalogPath = "/api/admin/plugins" // AdminReleasesPath lists a plugin's releases and publishes a new one. AdminReleasesPath = "/api/admin/plugins/%s/releases" // AdminYankPath withdraws one release. AdminYankPath = "/api/admin/plugins/%s/releases/%s/yank" // AdminArchivePath and AdminUnarchivePath retire and restore an entry. AdminArchivePath = "/api/admin/plugins/%s/archive" AdminUnarchivePath = "/api/admin/plugins/%s/unarchive" )
Paths, relative to the server base URL.
const ( // QueryAllowYanked acknowledges that a withdrawn release is being // downloaded on purpose. QueryAllowYanked = "allow_yanked" // The publisher's claim about the checkout the bytes were packed from. // The server cannot verify any of it, so it is recorded as a claim. QuerySourceRemote = "source_remote" QuerySourceCommit = "source_commit" QuerySourceBranch = "source_branch" QuerySourceDirty = "source_dirty" )
Query parameters.
const ( // TeamActivationsPath lists a team's activations and creates one. TeamActivationsPath = "/api/teams/%s/plugin-activations" // TeamActivationPath changes one activation: its pin, or whether it is // suspended. TeamActivationPath = "/api/teams/%s/plugin-activations/%s" // TeamPluginCurationPath sets who fills the team's activation list. TeamPluginCurationPath = "/api/teams/%s/plugin-curation" )
Team activation paths. An activation belongs to a team, so these are team-scoped where the catalog routes above are deployment-scoped.
const DigestHeader = "X-Buildmax-Digest"
DigestHeader carries a release's digest with its bytes, so a client verifies what it received without a second request.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivateRequest ¶
type ActivateRequest struct {
PluginName string `json:"plugin_name"`
Version string `json:"version,omitempty"`
}
ActivateRequest pins a release for a team. An empty Version takes the newest release the team could be pinned to.
type ActivationsResponse ¶
type ActivationsResponse struct {
Curation coreplugin.Curation `json:"curation"`
Activations []coreplugin.Activation `json:"activations"`
}
ActivationsResponse is what a team has activated and who fills the list.
The curation mode travels with the activations because reading one without the other misleads: an empty list means "nothing activated yet" in open mode and "nothing may be named" in curated mode.
type CatalogResponse ¶
type CatalogResponse struct {
Plugins []coreplugin.Plugin `json:"plugins"`
}
CatalogResponse is the browsable catalog.
type CreatePluginRequest ¶
type CreatePluginRequest struct {
Name string `json:"name"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description,omitempty"`
}
CreatePluginRequest reserves a catalog name.
type PluginResponse ¶
type PluginResponse struct {
Plugin coreplugin.Plugin `json:"plugin"`
Releases []coreplugin.Release `json:"releases"`
}
PluginResponse is one entry and everything published under it.
Releases includes withdrawn ones, marked. Hiding them would make an exact-version recovery impossible to discover, and choosing between releases needs the client's own version anyway.
type ReleasesResponse ¶
type ReleasesResponse struct {
Releases []coreplugin.Release `json:"releases"`
}
ReleasesResponse lists one plugin's releases for an administrator.
type SetCurationRequest ¶
type SetCurationRequest struct {
Curation coreplugin.Curation `json:"curation"`
}
SetCurationRequest chooses who fills the team's activation list.
type UpdateActivationRequest ¶
type UpdateActivationRequest struct {
Version *string `json:"version,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
UpdateActivationRequest changes one activation. Both fields are optional and they are separate decisions: moving a pin is not suspending, and a request naming neither changes nothing.
type YankReleaseRequest ¶
type YankReleaseRequest struct {
Reason string `json:"reason,omitempty"`
}
YankReleaseRequest withdraws one release.