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/model — 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 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 CatalogResponse ¶
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 model.Plugin `json:"plugin"`
Releases []model.PluginRelease `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 []model.PluginRelease `json:"releases"`
}
ReleasesResponse lists one plugin's releases for an administrator.
type YankReleaseRequest ¶
type YankReleaseRequest struct {
Reason string `json:"reason,omitempty"`
}
YankReleaseRequest withdraws one release.