pluginsvc

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package pluginsvc provides the default implementation of plugins.PluginService.

Phase 2 (this package) implements only the build/validate/push/list-builds/ delete-build/get-content surface. Install/uninstall/list/info land in Phase 3 (#5527); the New constructor returns the narrowed plugins.PluginService interface (which exposes only the Phase-2 methods), so Phase 3 widens both the interface and the concrete type together.

Index

Constants

View Source
const LocalBuildAnnotation = "dev.stacklok.toolhive.local-build"

LocalBuildAnnotation marks a tag in the local OCI store as produced by `thv plugin build` rather than an OCI pull (install, content preview). The value is always "true" when set; absence means "not a local build".

This is the SAME annotation key as skillsvc.LocalBuildAnnotation. It is generic by design (reverse-DNS namespaced) so it composes with other locally-built artifact types. ListBuilds filters by isPluginArtifact before trusting it, so a skill local-build tag cannot masquerade as a plugin build and vice versa.

The annotation is stamped at the descriptor level inside the store's root index.json, not on the manifest content. Two properties follow from that:

  1. Push resolves the artifact by digest, which returns a plain descriptor (oras-go's oci.Store strips annotations when the reference is a digest), so the marker never crosses the wire.
  2. Pull calls Store.Tag with the pulled digest, which also resolves by digest before tagging, so pulled tags inherit no annotations and stay invisible to ListBuilds.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) plugins.PluginService

New creates a new plugin service and returns it as a plugins.PluginService (the narrowed Phase-2 interface exposing only Validate/Build/Push/ListBuilds/DeleteBuild/GetContent). Phase 3 (#5527) widens the interface and concrete type together to add install/uninstall/ list/info; callers that need persistence then pass a WithStore option (added in that PR).

Types

type Option

type Option func(*service)

Option configures the plugin service.

func WithOCIStore

func WithOCIStore(store *ociplugins.Store) Option

WithOCIStore sets the local OCI store for plugin artifacts.

func WithPackager

func WithPackager(p ociplugins.PluginPackager) Option

WithPackager sets the plugin packager for building OCI artifacts.

func WithRegistryClient

func WithRegistryClient(rc ociplugins.RegistryClient) Option

WithRegistryClient sets the registry client for push/pull operations.

Jump to

Keyboard shortcuts

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