Documentation
¶
Overview ¶
Package pluginread serves an organization's published plugins to Packer's remote getter: the anonymous third surface of ADR-0027. The four request shapes are fixed by hashicorp/packer packer/plugin-getter/remote/getter.go (v1.16.1), not chosen here.
Index ¶
Constants ¶
View Source
const Prefix = "/plugins/"
Prefix is the root path the read plane owns.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(repository Repository, logger *slog.Logger) http.Handler
NewHandler serves the read plane. Every path it does not serve answers the same 404 as an unexposed registry, so nothing about the registry's state or contents is disclosed (ADR-0017).
Types ¶
type Repository ¶
type Repository interface {
ServedPluginVersions(ctx context.Context, organization, name string) ([]string, error)
ServedPluginFile(ctx context.Context, organization, name, version string, kind store.PluginFileKind, filename string) (store.ServedPluginFile, error)
OpenPluginObject(ctx context.Context, key string) (io.ReadCloser, error)
CountPluginDownload(ctx context.Context, tenant store.OrganizationTenant, pluginID uuid.UUID, version, platform string, day time.Time) error
}
Repository is what the read plane reads.
Click to show internal directories.
Click to hide internal directories.