Documentation
¶
Overview ¶
Package pluginmgr installs plugins from a deployment's Marketplace.
It is the mechanism both local surfaces share: the CLI and Desktop each own how they ask and what they print, and neither owns staging, digest verification, or the rename that puts a release in place. A second copy of that would be a second set of rules about when a half-installed plugin is visible.
Index ¶
- Variables
- func Inspect(dir string) (inspect.Package, error)
- func Pack(dir string) (io.Reader, func(), int64, error)
- func ReadSourceClaim(ctx context.Context, dir string) coreplugin.ReleaseSource
- func SetDisabled(name string, disabled bool) (string, error)
- func Uninstall(name string, force bool) (string, error)
- type Options
- type Plan
- type Session
- func (s *Session) Install(ctx context.Context, opts Options, release coreplugin.Release) error
- func (s *Session) ListActivations(ctx context.Context, teamID string) (*pluginwire.ActivationsResponse, error)
- func (s *Session) Publish(ctx context.Context, dir string) (*coreplugin.Release, error)
- func (s *Session) Resolve(ctx context.Context, opts Options) (Plan, error)
- func (s *Session) ServerURL() string
Constants ¶
This section is empty.
Variables ¶
var ErrIsCheckout = errors.New("the installed plugin is a Git checkout")
ErrIsCheckout means the installed copy is a Git working tree, which may hold work that exists nowhere else. How a surface offers to override that is the surface's own word — a flag here, a confirmation there — so the message says what is true and leaves the wording to the caller.
var ErrNotSignedIn = errors.New("not signed in: run `buildmax login` first")
ErrNotSignedIn means there is no login to reach a Marketplace with.
Functions ¶
func Pack ¶
Pack writes the archive to a temporary file rather than a buffer, so publishing a large plugin does not hold it twice in memory.
func ReadSourceClaim ¶
func ReadSourceClaim(ctx context.Context, dir string) coreplugin.ReleaseSource
ReadSourceClaim describes the checkout a package was packed from.
A directory that is not a repository produces an empty claim, which is not an error: a package assembled by hand is a legitimate thing to publish, and the catalog says so rather than inventing provenance.
func SetDisabled ¶
SetDisabled stops a plugin loading, or lets it load again.
Only the flag is written. Recording the source classification here would freeze an answer the directory can change afterwards.
Types ¶
type Options ¶
type Options struct {
Name string
// Version asks for one exact release. Empty takes the default selection.
Version string
// AllowYanked permits a withdrawn release, which a recovery has to say.
AllowYanked bool
// RequireInstalled refuses when the plugin is not there yet, which is what
// separates an update from an install.
RequireInstalled bool
}
Options describes which release a caller wants installed.
type Plan ¶
type Plan struct {
Release coreplugin.Release
// AlreadyInstalled means this exact release is the one already in place.
AlreadyInstalled bool
}
Plan is what an install would do, resolved before anything is downloaded.
It exists so a surface can show what is about to change while the decision is still open, which is the moment the capability report is worth reading.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is an authenticated connection to one deployment's Marketplace.
func (*Session) ListActivations ¶
func (s *Session) ListActivations(ctx context.Context, teamID string) (*pluginwire.ActivationsResponse, error)
ListActivations reads what a team has activated for its background runs.
It sits here rather than in the CLI so Desktop can show the same thing: a team's activations are a property of the deployment, not of this machine.