Files
grafana/apps/plugins/pkg/app/meta/provider.go
Will Browne f1dbbcbe00 Plugins: Add /meta and /metas APIs to plugins app (#113775)
* add /meta and /metas APIs

* wrapped storage route

* format file

* fix switch statement lint issue

* fix plugininstaller test

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
2025-11-24 18:20:11 +00:00

28 lines
712 B
Go

package meta
import (
"context"
"errors"
"time"
pluginsv0alpha1 "github.com/grafana/grafana/apps/plugins/pkg/apis/plugins/v0alpha1"
)
var (
ErrMetaNotFound = errors.New("not found")
)
// Result contains plugin metadata along with its recommended TTL.
type Result struct {
Meta pluginsv0alpha1.PluginMetaJSONData
TTL time.Duration
}
// Provider is used for retrieving plugin metadata.
type Provider interface {
// GetMeta retrieves plugin metadata for the given plugin ID and version.
// Returns the Result containing the PluginMetaJSONData and its recommended TTL.
// If the plugin is not found, returns ErrMetaNotFound.
GetMeta(ctx context.Context, pluginID, version string) (*Result, error)
}