pluginmarket

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnapshotSchemaVersion = "redeven.plugin_market_snapshot.v2"
	SnapshotSourceRemote  = "remote"
	SnapshotSourceCache   = "cache"
)

Variables

View Source
var (
	ErrInvalidResponse = errors.New("plugin market response is invalid")
	ErrUnavailable     = errors.New("plugin market is unavailable")
	ErrReleaseMissing  = errors.New("plugin market release is unavailable")
)

Functions

This section is empty.

Types

type CatalogPlugin

type CatalogPlugin struct {
	PluginID     string              `json:"plugin_id"`
	PublisherID  string              `json:"publisher_id"`
	Presentation PresentationCompact `json:"presentation"`
	Categories   []string            `json:"categories"`
	Channels     []string            `json:"channels"`
	Latest       LatestPointer       `json:"latest"`
	Release      *LatestRelease      `json:"release,omitempty"`
}

type CatalogResponse

type CatalogResponse struct {
	Data []PluginSummary `json:"data"`
	Meta Meta            `json:"meta"`
}

type Compatibility

type Compatibility struct {
	MinRedevenVersion     string `json:"min_redeven_version"`
	MinReDevPluginVersion string `json:"min_redevplugin_version"`
}

type IconAsset

type IconAsset struct {
	Data      []byte
	MediaType string
	SHA256    string
}

type InstallPreview

type InstallPreview struct {
	Release               LatestRelease                       `json:"release"`
	ReleaseRef            host.PluginReleaseRef               `json:"release_ref"`
	TransportAssets       []TransportAsset                    `json:"transport_assets"`
	Compatibility         Compatibility                       `json:"compatibility"`
	SecuritySummary       host.ExternalPackageSecuritySummary `json:"security_summary"`
	ReleaseIdentityDigest string                              `json:"release_identity_digest"`
	ManifestSHA256        string                              `json:"manifest_sha256"`
	ContractSetSHA256     string                              `json:"contract_set_sha256"`
	SummarySHA256         string                              `json:"summary_sha256"`
}

InstallPreview is the market's verified, display-ready projection for the exact release. ReDevPlugin remains the installation authority; Redeven only transports this evidence to the UI and binds the command to its digests.

type LatestPointer

type LatestPointer struct {
	Channel            string          `json:"channel"`
	Version            string          `json:"version"`
	AvailabilityStatus string          `json:"availability_status"`
	InstallPreview     *InstallPreview `json:"install_preview,omitempty"`
}

type LatestRelease

type LatestRelease struct {
	PluginID        string        `json:"plugin_id"`
	Channel         string        `json:"channel"`
	Version         string        `json:"version"`
	Source          ReleaseSource `json:"source"`
	Asset           ReleaseAsset  `json:"asset"`
	ReleaseRefAsset ReleaseAsset  `json:"release_ref"`
	TrustRoot       struct {
		URL    string `json:"url"`
		SHA256 string `json:"sha256"`
	} `json:"trust_root"`
	PublisherReleaseRef   PublisherReleaseRef `json:"publisher_release_ref"`
	TransportAssets       []TransportAsset    `json:"transport_assets"`
	SignerKeyID           string              `json:"signer_key_id"`
	Compatibility         Compatibility       `json:"compatibility"`
	ReleaseIdentityDigest string              `json:"release_identity_digest"`
	InstallPreview        *InstallPreview     `json:"install_preview,omitempty"`
}

func (LatestRelease) RemoteProjection

func (release LatestRelease) RemoteProjection() (host.PluginReleaseRef, []remoterelease.Asset, error)

type LatestReleaseResponse

type LatestReleaseResponse struct {
	Data LatestRelease `json:"data"`
	Meta Meta          `json:"meta"`
}

type Meta

type Meta struct {
	RequestID  string `json:"request_id"`
	Generation int64  `json:"generation"`
	Stale      bool   `json:"stale"`
	NextCursor string `json:"next_cursor,omitempty"`
	CachedAt   string `json:"cached_at,omitempty"`
}

type PackageHashes

type PackageHashes struct {
	PackageSHA256  string `json:"package_sha256"`
	ManifestSHA256 string `json:"manifest_sha256"`
	EntriesSHA256  string `json:"entries_sha256"`
}

type PluginDetail

type PluginDetail struct {
	PluginID      string           `json:"plugin_id"`
	PublisherID   string           `json:"publisher_id"`
	Presentation  PresentationFull `json:"presentation"`
	Categories    []string         `json:"categories"`
	Channels      []string         `json:"channels"`
	Repository    PluginRepository `json:"repository"`
	Compatibility Compatibility    `json:"compatibility"`
	Status        string           `json:"status"`
	Latest        []LatestPointer  `json:"latest"`
}

type PluginDetailResponse

type PluginDetailResponse struct {
	Data PluginDetail `json:"data"`
	Meta Meta         `json:"meta"`
}

type PluginRepository

type PluginRepository struct {
	Provider     string `json:"provider"`
	RepositoryID int64  `json:"repository_id"`
	Owner        string `json:"owner"`
	Name         string `json:"name"`
	URL          string `json:"url"`
}

type PluginSummary

type PluginSummary struct {
	PluginID     string              `json:"plugin_id"`
	PublisherID  string              `json:"publisher_id"`
	Presentation PresentationCompact `json:"presentation"`
	Categories   []string            `json:"categories"`
	Channels     []string            `json:"channels"`
	Latest       LatestPointer       `json:"latest"`
}

type PresentationCatalog

type PresentationCatalog = PresentationFull

PresentationCatalog is the normalized author presentation exchanged by the market and host. Catalog responses may omit detail-only arrays; detail responses populate every field.

type PresentationCompact

type PresentationCompact struct {
	DefaultLocale string                      `json:"default_locale"`
	Icon          *PresentationIcon           `json:"icon,omitempty"`
	Locales       []PresentationCompactLocale `json:"locales"`
}

type PresentationCompactLocale

type PresentationCompactLocale struct {
	Locale        string   `json:"locale"`
	Name          string   `json:"name"`
	PublisherName string   `json:"publisher_name,omitempty"`
	Summary       string   `json:"summary"`
	Keywords      []string `json:"keywords"`
}

type PresentationFull

type PresentationFull struct {
	DefaultLocale string                   `json:"default_locale"`
	Icon          *PresentationIcon        `json:"icon,omitempty"`
	Locales       []PresentationFullLocale `json:"locales"`
}

type PresentationFullLocale

type PresentationFullLocale struct {
	Locale        string                `json:"locale"`
	Name          string                `json:"name"`
	PublisherName string                `json:"publisher_name,omitempty"`
	Summary       string                `json:"summary"`
	Description   []string              `json:"description"`
	Highlights    []string              `json:"highlights"`
	Keywords      []string              `json:"keywords"`
	Surfaces      []PresentationSurface `json:"surfaces"`
	Settings      []PresentationSetting `json:"settings"`
}

type PresentationIcon

type PresentationIcon struct {
	URL       string `json:"url"`
	MediaType string `json:"media_type"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	SHA256    string `json:"sha256"`
}

type PresentationLocale

type PresentationLocale = PresentationFullLocale

type PresentationSetting

type PresentationSetting struct {
	Key     string                      `json:"key"`
	Label   string                      `json:"label"`
	Options []PresentationSettingOption `json:"options"`
}

type PresentationSettingOption

type PresentationSettingOption struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

type PresentationSurface

type PresentationSurface struct {
	SurfaceID string `json:"surface_id"`
	Label     string `json:"label"`
}

type PublicKey

type PublicKey struct {
	Algorithm string `json:"algorithm"`
	KeyID     string `json:"key_id"`
	PublicKey string `json:"public_key"`
}

type PublishedFile

type PublishedFile struct {
	Locator   string `json:"locator"`
	AssetName string `json:"asset_name"`
	SHA256    string `json:"sha256"`
	Size      int64  `json:"size"`
}

type PublisherReleaseRef

type PublisherReleaseRef struct {
	SchemaVersion string                `json:"schema_version"`
	ReleaseRef    host.PluginReleaseRef `json:"release_ref"`
	Root          PublicKey             `json:"root"`
	Files         []PublishedFile       `json:"files"`
}

type ReleaseAsset

type ReleaseAsset struct {
	AssetID int64  `json:"asset_id"`
	Name    string `json:"name"`
	URL     string `json:"url"`
	Size    int64  `json:"size"`
	SHA256  string `json:"sha256"`
}

type ReleaseSource

type ReleaseSource struct {
	Provider        string `json:"provider"`
	RepositoryID    int64  `json:"repository_id"`
	RepositoryOwner string `json:"repository_owner"`
	RepositoryName  string `json:"repository_name"`
	ReleaseID       int64  `json:"release_id"`
	Tag             string `json:"tag"`
	TargetCommit    string `json:"target_commit"`
}

type ResolvedPresentation

type ResolvedPresentation = pluginmanifest.ResolvedPresentation

func ResolvePresentation

func ResolvePresentation(presentation PresentationCatalog, requestedLocale string) ResolvedPresentation

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(options ServiceOptions) (*Service, error)

func (*Service) CachedSnapshot

func (service *Service) CachedSnapshot() (Snapshot, bool)

CachedSnapshot returns only already-verified local evidence and never starts a network request. It lets the host render its last known catalog and bind a pending release provider before the background market refresh completes.

func (*Service) Detail

func (service *Service) Detail(ctx context.Context, pluginID string) (PluginDetail, int64, error)

func (*Service) Icon

func (service *Service) Icon(ctx context.Context, pluginID string, expected PresentationIcon) (IconAsset, error)

func (*Service) LatestRelease

func (service *Service) LatestRelease(ctx context.Context, pluginID, channel string) (LatestRelease, error)

func (*Service) Snapshot

func (service *Service) Snapshot(ctx context.Context) (Snapshot, error)

type ServiceOptions

type ServiceOptions struct {
	Origin             string
	CachePath          string
	HTTPClient         *http.Client
	Now                func() time.Time
	RedevenVersion     string
	ReDevPluginVersion string
}

type Snapshot

type Snapshot struct {
	SchemaVersion string          `json:"schema_version"`
	Generation    int64           `json:"generation"`
	ETag          string          `json:"etag,omitempty"`
	CachedAt      time.Time       `json:"cached_at"`
	Stale         bool            `json:"stale"`
	Source        string          `json:"source"`
	Plugins       []CatalogPlugin `json:"plugins"`
}

func (Snapshot) Clone

func (snapshot Snapshot) Clone() Snapshot

func (Snapshot) LatestRelease

func (snapshot Snapshot) LatestRelease(pluginID, channel string) (LatestRelease, error)

type TransportAsset

type TransportAsset struct {
	Locator string `json:"locator"`
	ReleaseAsset
}

Jump to

Keyboard shortcuts

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