Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPluginVersionCompatibility ¶
func CheckPluginVersionCompatibility( installedPluginVersion string, versionConstraint string, ) (bool, error)
CheckPluginVersionCompatibility checks if the installed plugin version is compatible with the given version constraint. Version constraints are in the format of:
- `^1.2.3` for minor range constraint
- `~1.2.3` for patch range constraint
- `1.2.3` for exact version
func ToConfigDefinitionProviders ¶
func ToConfigDefinitionProviders[PluginSuperType DefinitionProvider]( providers map[string]PluginSuperType, ) map[string]DefinitionProvider
ToConfigDefinitionProviders is a helper function that converts a map of plugins (either transformers or providers) to a map of the simplified PluginConfigDefinitionProvider interface. Maps and slices of an interface aren't interchangeable between super type and subtypes.
Types ¶
type DefinitionProvider ¶
type DefinitionProvider interface {
ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)
}
DefinitionProvider is an interface that defines any plugin type that provides a config definition schema.
type Preparer ¶
type Preparer interface {
// Prepare validates and populates default values for the provided configuration
// using the plugin-provided config definition schemas.
// It returns diagnostics for validation errors,
// and an error if something went wrong during validation and preparation.
// If validate is set to false, this will skip validation
// and only populate default values.
Prepare(
ctx context.Context,
blueprintOpConfig *types.BlueprintOperationConfig,
validate bool,
) (*types.BlueprintOperationConfig, []*core.Diagnostic, error)
}
Preparer provides an interface for a service that validates and prepares plugin-specific configuration against the plugin-provided config definition schema.
func NewDefaultPreparer ¶
func NewDefaultPreparer( providers map[string]DefinitionProvider, transformers map[string]DefinitionProvider, pluginManager pluginservicev1.Manager, ) Preparer
NewDefaultPreparer creates a new default implementation of a service that validates and populates defaults for plugin-specific configuration using the plugin-provided config definition schemas.