Documentation
¶
Index ¶
- Constants
- Variables
- func Count() int
- func DryRunFromContext(ctx context.Context) bool
- func Has(name string) bool
- func List() []string
- func MaskValue(value any, isSecret bool) string
- func ParametersFromContext(ctx context.Context) (map[string]any, bool)
- func Register(p Provider) error
- func ResetGlobalExecutor()
- func ResetGlobalRegistry()
- func ResolverContextFromContext(ctx context.Context) (map[string]any, bool)
- func ValidateDescriptor(desc *Descriptor) error
- func WithDryRun(ctx context.Context, dryRun bool) context.Context
- func WithExecutionMode(ctx context.Context, mode Capability) context.Context
- func WithIOStreams(ctx context.Context, streams *IOStreams) context.Context
- func WithIterationContext(ctx context.Context, iterCtx *IterationContext) context.Context
- func WithParameters(ctx context.Context, parameters map[string]any) context.Context
- func WithResolverContext(ctx context.Context, resolverContext map[string]any) context.Context
- type Capability
- type Contact
- type Descriptor
- type Example
- type ExecutionMetrics
- type ExecutionResult
- func Execute(ctx context.Context, provider Provider, inputs map[string]any) (*ExecutionResult, error)
- func ExecuteByName(ctx context.Context, providerName string, inputs map[string]any) (*ExecutionResult, error)
- func MustExecuteByName(ctx context.Context, providerName string, inputs map[string]any) *ExecutionResult
- type Executor
- func (e *Executor) Execute(ctx context.Context, provider Provider, inputs map[string]any) (*ExecutionResult, error)
- func (e *Executor) ExecuteByName(ctx context.Context, providerName string, inputs map[string]any) (*ExecutionResult, error)
- func (e *Executor) MustExecuteByName(ctx context.Context, providerName string, inputs map[string]any) *ExecutionResult
- type ExecutorOption
- type IOStreams
- type InputResolver
- type InputValue
- type IterationContext
- type Link
- type Metrics
- func (m *Metrics) Disable()
- func (m *Metrics) Enable()
- func (m *Metrics) GetAllMetrics() map[string]*ExecutionMetrics
- func (m *Metrics) GetMetrics(providerName string) *ExecutionMetrics
- func (m *Metrics) IsEnabled() bool
- func (m *Metrics) Record(ctx context.Context, providerName string, duration time.Duration, success bool)
- func (m *Metrics) Reset()
- type Output
- type Provider
- type Registry
- func (r *Registry) Clear()
- func (r *Registry) Count() int
- func (r *Registry) DescriptorLookup() func(name string) *Descriptor
- func (r *Registry) Get(name string) (Provider, bool)
- func (r *Registry) Has(name string) bool
- func (r *Registry) List() []string
- func (r *Registry) ListByCapability(capability Capability) []Provider
- func (r *Registry) ListByCategory(category string) []Provider
- func (r *Registry) ListProviders() []Provider
- func (r *Registry) MustGet(name string) Provider
- func (r *Registry) Register(p Provider) error
- func (r *Registry) Unregister(name string) bool
- type RegistryOption
- type SchemaValidator
- type ValidationError
- type ValidationErrors
Constants ¶
const (
// SecretMask is the string used to redact secret values in logs and errors
SecretMask = "***REDACTED***"
)
Variables ¶
var GlobalMetrics = &Metrics{enabled: false}
GlobalMetrics is the default metrics collector. Metrics collection is disabled by default; call Enable() to turn it on.
Functions ¶
func DryRunFromContext ¶
DryRunFromContext retrieves the dry-run flag from the context. Defaults to false if not set.
func MaskValue ¶
MaskValue redacts a value if it should be kept secret. This is useful for logging and error messages.
func ParametersFromContext ¶
ParametersFromContext retrieves the CLI parameters map from the context. Returns the parameters map and true if found, nil and false otherwise.
func ResetGlobalExecutor ¶
func ResetGlobalExecutor()
ResetGlobalExecutor resets the global executor to a new instance. This is primarily for testing purposes.
func ResetGlobalRegistry ¶
func ResetGlobalRegistry()
ResetGlobalRegistry clears the global registry. This is primarily for testing purposes.
func ResolverContextFromContext ¶
ResolverContextFromContext retrieves the resolver context map from the context.
func ValidateDescriptor ¶
func ValidateDescriptor(desc *Descriptor) error
ValidateDescriptor validates that a Descriptor meets all requirements. Returns an error if:
- OutputSchemas is missing for any declared capability
- Required fields are missing for capabilities that mandate them
- Field types don't match the expected JSON Schema types
func WithDryRun ¶
WithDryRun returns a new context with the dry-run flag set.
func WithExecutionMode ¶
func WithExecutionMode(ctx context.Context, mode Capability) context.Context
WithExecutionMode returns a new context with the specified execution mode (capability).
func WithIOStreams ¶ added in v0.4.0
WithIOStreams returns a new context with IO streams for provider terminal output.
func WithIterationContext ¶
func WithIterationContext(ctx context.Context, iterCtx *IterationContext) context.Context
WithIterationContext returns a new context with the iteration context.
func WithParameters ¶
WithParameters returns a new context with the CLI parameters map. Parameters are parsed from -r/--resolver flags and stored for retrieval by the parameter provider.
Types ¶
type Capability ¶
type Capability string
Capability represents the types of operations a provider can perform.
const ( CapabilityFrom Capability = "from" CapabilityTransform Capability = "transform" CapabilityValidation Capability = "validation" CapabilityAuthentication Capability = "authentication" CapabilityAction Capability = "action" )
func ExecutionModeFromContext ¶
func ExecutionModeFromContext(ctx context.Context) (Capability, bool)
ExecutionModeFromContext retrieves the execution mode from the context.
func (Capability) IsValid ¶
func (c Capability) IsValid() bool
IsValid checks if the capability is valid.
func (Capability) String ¶
func (c Capability) String() string
String returns the string representation.
type Contact ¶
type Contact struct {
Name string `json:"name,omitempty" yaml:"name,omitempty" doc:"Maintainer name" maxLength:"60" example:"Jane Doe"`
Email string `json:"email,omitempty" yaml:"email,omitempty" doc:"Maintainer email" format:"email" maxLength:"100"`
}
Contact represents maintainer contact information.
type Descriptor ¶
type Descriptor struct {
// Name is the unique identifier for this provider. Must be lowercase with hyphens only.
// Used to reference the provider in configurations and the registry.
Name string `` /* 145-byte string literal not displayed */
// DisplayName is the human-readable name shown in UIs and documentation.
// Optional - defaults to Name if not specified.
DisplayName string `` /* 129-byte string literal not displayed */
// APIVersion indicates the provider API contract version (e.g., "v1").
// Used for compatibility checking and migration support.
APIVersion string `json:"apiVersion" yaml:"apiVersion" doc:"Provider API version" example:"v1" pattern:"^v[0-9]+$" required:"true"`
// Version is the semantic version of this provider implementation.
// Follows semver conventions for versioning provider releases.
Version *semver.Version `json:"version" yaml:"version" doc:"Semantic version" required:"true"`
// Description provides a concise explanation of what the provider does.
// Displayed in catalogs, help text, and documentation.
Description string `json:"description" yaml:"description" doc:"Provider description" minLength:"10" maxLength:"500" required:"true"`
// Schema defines the structure and validation rules for provider inputs using JSON Schema.
// Used for input validation, documentation generation, and UI form building.
Schema *jsonschema.Schema `json:"schema" yaml:"schema" doc:"Input schema (JSON Schema)" required:"true"`
// OutputSchemas defines the output structure for each supported capability using JSON Schema.
// Each capability can produce different output shapes. Required for all declared capabilities.
// Certain capabilities have required minimum fields:
// - validation: must include "valid" (boolean) and "errors" (array)
// - authentication: must include "authenticated" (boolean) and "token" (string)
// - action: must include "success" (boolean)
// - from: no required fields
// - transform: no required fields
OutputSchemas map[Capability]*jsonschema.Schema `json:"outputSchemas" yaml:"outputSchemas" doc:"Output schemas per capability (JSON Schema)" required:"true"`
// SensitiveFields lists property names that contain sensitive data and should be redacted
// in logs, errors, and snapshot output. Replaces the old per-property IsSecret flag.
SensitiveFields []string `` /* 126-byte string literal not displayed */
// Decode converts validated map[string]any inputs into strongly-typed structs for internal use.
// Called after schema validation but before Execute(). Optional - providers can work with map[string]any directly.
// When Decode is set, the Executor calls it and passes the result directly to Execute().
Decode func(map[string]any) (any, error) `json:"-" yaml:"-"`
// ExtractDependencies extracts resolver dependencies from the provider's inputs.
// Called during dependency graph building to determine execution order.
// Optional - if nil, the generic extraction logic is used (which handles common patterns like
// CEL expressions with _.resolverName and Go templates with {{.resolverName}}).
// Providers should implement this when they have custom input formats or need special handling
// (e.g., go-template provider with custom delimiters).
// The function receives the raw inputs map and returns a slice of resolver names that are referenced.
ExtractDependencies func(inputs map[string]any) []string `json:"-" yaml:"-"`
// MockBehavior describes what the provider does during dry-run/mock execution.
// Should explain the simulated behavior without side effects.
MockBehavior string `json:"mockBehavior" yaml:"mockBehavior" doc:"Dry-run behavior description" minLength:"10" maxLength:"500" required:"true"`
// Capabilities declares the execution contexts this provider supports.
// Determines where the provider can be used (from, transform, validation, etc.).
Capabilities []Capability `json:"capabilities" yaml:"capabilities" doc:"Supported execution contexts" minItems:"1" required:"true"`
// Category classifies the provider for organization in catalogs and documentation.
// Examples: "network", "storage", "security", "utility".
Category string `json:"category,omitempty" yaml:"category,omitempty" doc:"Classification category" maxLength:"50" example:"network"`
// Tags are searchable keywords for discovery and filtering.
// Used in catalog searches and provider listings.
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty" doc:"Searchable keywords" maxItems:"20"`
// Icon is a URL to an image representing the provider.
// Displayed in UIs and documentation alongside the provider name.
Icon string `json:"icon,omitempty" yaml:"icon,omitempty" doc:"Icon URL" format:"uri" maxLength:"500"`
// Links provides related resources such as documentation, source code, or tutorials.
Links []Link `json:"links,omitempty" yaml:"links,omitempty" doc:"Related links" maxItems:"10"`
// Examples contains sample configurations demonstrating provider usage.
// Shown in documentation and can be used for testing.
Examples []Example `json:"examples,omitempty" yaml:"examples,omitempty" doc:"Usage examples" maxItems:"10"`
// Deprecated: This field indicates the provider should no longer be used.
// Deprecated providers may be removed in future versions.
Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty" doc:"Deprecation status"`
// Beta indicates the provider is experimental and may have breaking changes.
// Beta providers are not recommended for production use.
Beta bool `json:"beta,omitempty" yaml:"beta,omitempty" doc:"Beta status"`
// Maintainers lists the people or teams responsible for this provider.
// Used for contact and support information.
Maintainers []Contact `json:"maintainers,omitempty" yaml:"maintainers,omitempty" doc:"Maintainer contacts" maxItems:"10"`
}
Descriptor contains provider identity, versioning, schemas, capabilities, and catalog metadata.
func (*Descriptor) IsSensitiveField ¶
func (d *Descriptor) IsSensitiveField(name string) bool
IsSensitiveField checks whether a field name is marked as sensitive in the descriptor.
type Example ¶
type Example struct {
Name string `json:"name,omitempty" yaml:"name,omitempty" doc:"Example name" maxLength:"50" example:"Basic usage"`
Description string `json:"description,omitempty" yaml:"description,omitempty" doc:"Example description" maxLength:"300"`
YAML string `json:"yaml" yaml:"yaml" doc:"YAML example" minLength:"10" maxLength:"2000" required:"true"`
}
Example represents a usage example for a provider.
type ExecutionMetrics ¶
type ExecutionMetrics struct {
ExecutionCount uint64 `json:"executionCount" yaml:"executionCount" doc:"Total number of executions"`
SuccessCount uint64 `json:"successCount" yaml:"successCount" doc:"Number of successful executions"`
FailureCount uint64 `json:"failureCount" yaml:"failureCount" doc:"Number of failed executions"`
TotalDurationNs uint64 `json:"totalDurationNs" yaml:"totalDurationNs" doc:"Total execution duration in nanoseconds"`
LastExecutionNs uint64 `json:"lastExecutionNs" yaml:"lastExecutionNs" doc:"Timestamp of last execution in nanoseconds since epoch"`
}
ExecutionMetrics tracks execution statistics for a provider.
func (*ExecutionMetrics) AverageDuration ¶
func (m *ExecutionMetrics) AverageDuration() time.Duration
AverageDuration returns the average execution duration.
func (*ExecutionMetrics) SuccessRate ¶
func (m *ExecutionMetrics) SuccessRate() float64
SuccessRate returns the success rate as a percentage (0-100).
type ExecutionResult ¶
type ExecutionResult struct {
// Provider is the provider that was executed
Provider Provider `json:"provider" yaml:"provider" doc:"The provider that was executed"`
// Output is the validated output from the provider
Output Output `json:"output" yaml:"output" doc:"The validated output from the provider"`
// DryRun indicates whether this was a dry-run execution
DryRun bool `json:"dryRun" yaml:"dryRun" doc:"Whether this was a dry-run execution"`
// ExecutionDuration is the total time taken to execute the provider
ExecutionDuration time.Duration `json:"executionDuration" yaml:"executionDuration" doc:"The total time taken to execute the provider" example:"1000000000"`
// ResolvedInputs are the inputs after resolution (for debugging)
ResolvedInputs map[string]any `json:"resolvedInputs,omitempty" yaml:"resolvedInputs,omitempty" doc:"The resolved inputs (for debugging)"`
}
ExecutionResult contains the result of a provider execution.
func Execute ¶
func Execute(ctx context.Context, provider Provider, inputs map[string]any) (*ExecutionResult, error)
Execute executes a provider using the global executor.
func ExecuteByName ¶
func ExecuteByName(ctx context.Context, providerName string, inputs map[string]any) (*ExecutionResult, error)
ExecuteByName executes a provider by name using the global executor.
func MustExecuteByName ¶
func MustExecuteByName(ctx context.Context, providerName string, inputs map[string]any) *ExecutionResult
MustExecuteByName executes a provider by name using the global executor and panics on failure.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor orchestrates provider execution with input resolution and validation.
func GetGlobalExecutor ¶
func GetGlobalExecutor() *Executor
GetGlobalExecutor returns the global executor instance.
func NewExecutor ¶
func NewExecutor(opts ...ExecutorOption) *Executor
NewExecutor creates a new provider executor with the given options.
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, provider Provider, inputs map[string]any) (*ExecutionResult, error)
Execute executes a provider with the given inputs and context. It performs: 1. Execution mode validation against provider capabilities 2. Input resolution (literal, resolver bindings, CEL, templates) 3. Input validation against provider schema 4. Optional decode (if Descriptor.Decode is set) 5. Provider execution (provider checks context for dry-run mode) 6. Output validation against output schema
The context should contain: - Execution mode (via WithExecutionMode) - REQUIRED - Dry-run flag (via WithDryRun) - providers check this to modify behavior - Resolver context (via WithResolverContext) for input resolution
Note: Providers are responsible for handling dry-run mode by checking DryRunFromContext(ctx) and returning appropriate outputs without performing side effects.
func (*Executor) ExecuteByName ¶
func (e *Executor) ExecuteByName(ctx context.Context, providerName string, inputs map[string]any) (*ExecutionResult, error)
ExecuteByName executes a provider by name from the global registry. This is a convenience method that looks up the provider and calls Execute.
func (*Executor) MustExecuteByName ¶
func (e *Executor) MustExecuteByName(ctx context.Context, providerName string, inputs map[string]any) *ExecutionResult
MustExecuteByName executes a provider by name and panics if the provider is not found or execution fails. This is useful for initialization code where a provider must exist and execute successfully.
type ExecutorOption ¶
type ExecutorOption func(*Executor)
ExecutorOption is a functional option for configuring an Executor.
func WithSchemaValidator ¶
func WithSchemaValidator(validator *SchemaValidator) ExecutorOption
WithSchemaValidator sets a custom schema validator.
type IOStreams ¶ added in v0.4.0
type IOStreams struct {
// Out is the writer for standard output (typically os.Stdout).
Out io.Writer
// ErrOut is the writer for standard error output (typically os.Stderr).
ErrOut io.Writer
}
IOStreams holds terminal IO writers for providers that support streaming output. Providers can use these to write output directly to the terminal during execution, while still capturing data for inter-action dependencies.
func IOStreamsFromContext ¶ added in v0.4.0
IOStreamsFromContext retrieves the IO streams from the context. Returns the IO streams and true if found, nil and false otherwise. Providers should check this to determine if they can stream output to the terminal.
type InputResolver ¶
type InputResolver struct {
// contains filtered or unexported fields
}
InputResolver resolves provider inputs from various forms into concrete values.
func NewInputResolver ¶
func NewInputResolver(ctx context.Context, schema *jsonschema.Schema, sensitiveFields []string) *InputResolver
NewInputResolver creates a new input resolver for the given schema and context. The sensitiveFields parameter lists field names that should be redacted in errors.
func (*InputResolver) ResolveInputs ¶
func (r *InputResolver) ResolveInputs(rawInputs any) (map[string]any, error)
ResolveInputs resolves all provider inputs from their declared forms into concrete values. It validates exclusivity (only one form per property), resolves each input based on its form, applies type coercion, and validates the final values against the schema.
rawInputs is expected to be map[string]InputValue or map[string]any (for backwards compatibility). Returns a map[string]any with resolved concrete values, ready for provider execution.
type InputValue ¶
type InputValue struct {
Literal any `json:"literal,omitempty" yaml:"literal,omitempty" doc:"Direct static value"`
Rslvr string `json:"rslvr,omitempty" yaml:"rslvr,omitempty" doc:"Resolver binding (e.g., 'environment')"`
Expr celexp.Expression `json:"expr,omitempty" yaml:"expr,omitempty" doc:"CEL expression to evaluate"`
Tmpl gotmpl.GoTemplatingContent `json:"tmpl,omitempty" yaml:"tmpl,omitempty" doc:"Go template to render"`
}
InputValue represents a single input value with exactly one form specified. Only one of Literal, Rslvr, Expr, or Tmpl should be set.
type IterationContext ¶
type IterationContext struct {
// Item is the current element being iterated over.
Item any `json:"item" yaml:"item" doc:"Current element in the iteration."`
// Index is the current index in the iteration.
Index int `json:"index" yaml:"index" doc:"Current zero-based index in the iteration."`
// ItemAlias is the custom variable name for the current item (empty if using default __item).
ItemAlias string `json:"itemAlias,omitempty" yaml:"itemAlias,omitempty" doc:"Custom variable name for current item."`
// IndexAlias is the custom variable name for the current index (empty if using default __index).
IndexAlias string `json:"indexAlias,omitempty" yaml:"indexAlias,omitempty" doc:"Custom variable name for current index."`
}
IterationContext holds information about the current forEach iteration. This is passed to providers to enable them to access iteration variables as top-level CEL variables.
func IterationContextFromContext ¶
func IterationContextFromContext(ctx context.Context) (*IterationContext, bool)
IterationContextFromContext retrieves the iteration context from the context. Returns the iteration context and true if found, nil and false otherwise.
type Link ¶
type Link struct {
Name string `json:"name,omitempty" yaml:"name,omitempty" doc:"Link name" maxLength:"30" example:"Documentation"`
URL string `json:"url,omitempty" yaml:"url,omitempty" doc:"Link URL" format:"uri" maxLength:"500"`
}
Link represents a named hyperlink.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics provides global provider metrics collection. It is safe for concurrent use.
func (*Metrics) GetAllMetrics ¶
func (m *Metrics) GetAllMetrics() map[string]*ExecutionMetrics
GetAllMetrics returns a map of all provider metrics. The returned map is a copy and safe to modify.
func (*Metrics) GetMetrics ¶
func (m *Metrics) GetMetrics(providerName string) *ExecutionMetrics
GetMetrics returns metrics for a specific provider. Returns nil if no metrics have been recorded for the provider.
type Output ¶
type Output struct {
Data any `json:"data" yaml:"data" doc:"Provider output data" required:"true"`
Warnings []string `json:"warnings,omitempty" yaml:"warnings,omitempty" doc:"Non-fatal warning messages" maxItems:"50"`
Metadata map[string]any `json:"metadata,omitempty" yaml:"metadata,omitempty" doc:"Execution metadata"`
// Streamed indicates that the provider already wrote its primary output
// (e.g., stdout/stderr) directly to the terminal via IOStreams from context.
// When true, the CLI output layer should not re-print the streamed content.
Streamed bool `json:"streamed,omitempty" yaml:"streamed,omitempty" doc:"Whether output was already streamed to terminal"`
}
Output is the standardized return structure for all provider executions.
type Provider ¶
type Provider interface {
// Descriptor returns the provider's metadata, schema, and capabilities.
Descriptor() *Descriptor
// Execute runs the provider logic with resolved inputs.
// The input parameter is either:
// - map[string]any if Descriptor().Decode is nil
// - The decoded type if Descriptor().Decode is set and returns a typed struct
// Resolver values can be accessed via ResolverContextFromContext(ctx).
// Execution mode and dry-run flag are available via ExecutionModeFromContext(ctx) and DryRunFromContext(ctx).
Execute(ctx context.Context, input any) (*Output, error)
}
Provider is the core interface that all providers must implement. Providers are stateless execution primitives that perform single, well-defined operations.
func ListByCapability ¶
func ListByCapability(capability Capability) []Provider
ListByCapability returns providers with the given capability from the global registry.
func ListByCategory ¶
ListByCategory returns providers in the given category from the global registry.
func ListProviders ¶
func ListProviders() []Provider
ListProviders returns all providers from the global registry.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages provider registration and discovery. It ensures global name uniqueness and maintains the latest stable version of each provider.
func GetGlobalRegistry ¶
func GetGlobalRegistry() *Registry
GetGlobalRegistry returns the global registry instance. This is useful for testing or when you need direct access to the registry.
func NewRegistry ¶
func NewRegistry(opts ...RegistryOption) *Registry
NewRegistry creates a new provider registry with the given options.
func (*Registry) Clear ¶
func (r *Registry) Clear()
Clear removes all providers from the registry. This is primarily for testing purposes.
func (*Registry) DescriptorLookup ¶
func (r *Registry) DescriptorLookup() func(name string) *Descriptor
DescriptorLookup returns a function that looks up provider descriptors by name. This is used for dependency extraction during resolver phase building. The returned function returns nil if the provider is not found.
func (*Registry) Get ¶
Get retrieves a provider by name. Returns the provider and true if found, nil and false otherwise.
func (*Registry) List ¶
List returns a list of all registered provider names. The list is sorted alphabetically.
func (*Registry) ListByCapability ¶
func (r *Registry) ListByCapability(capability Capability) []Provider
ListByCapability returns providers that support the given capability. The list is sorted alphabetically by provider name.
func (*Registry) ListByCategory ¶
ListByCategory returns providers in the given category. The list is sorted alphabetically by provider name.
func (*Registry) ListProviders ¶
ListProviders returns a list of all registered providers. The list is sorted alphabetically by provider name.
func (*Registry) MustGet ¶
MustGet retrieves a provider by name and panics if not found. This is useful for initialization code where a provider must exist.
func (*Registry) Register ¶
Register registers a provider in the registry. Returns an error if: - Provider is nil - Provider descriptor is invalid - Provider name already exists (unless allowOverwrite is true) - Provider version is older than existing version
func (*Registry) Unregister ¶
Unregister removes a provider from the registry. Returns true if the provider was removed, false if it didn't exist. This is primarily for testing purposes.
type RegistryOption ¶
type RegistryOption func(*registryOptions)
RegistryOption is a functional option for configuring a Registry.
func WithAllowOverwrite ¶
func WithAllowOverwrite(allow bool) RegistryOption
WithAllowOverwrite allows overwriting existing providers in the registry. This is primarily for testing purposes and should not be used in production.
type SchemaValidator ¶
type SchemaValidator struct{}
SchemaValidator provides validation for provider inputs and outputs against JSON Schema definitions.
func NewSchemaValidator ¶
func NewSchemaValidator() *SchemaValidator
NewSchemaValidator creates a new schema validator.
func (*SchemaValidator) ValidateInputs ¶
func (sv *SchemaValidator) ValidateInputs(inputs map[string]any, schema *jsonschema.Schema) error
ValidateInputs validates provider inputs against the JSON Schema definition.
func (*SchemaValidator) ValidateOutput ¶
func (sv *SchemaValidator) ValidateOutput(output any, schema *jsonschema.Schema) error
ValidateOutput validates provider output data against the JSON Schema definition.
type ValidationError ¶
type ValidationError struct {
Field string
Value any
Constraint string
Message string
Actual string
Expected string
}
ValidationError represents a single field validation error with contextual information.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
type ValidationErrors ¶
type ValidationErrors []*ValidationError
ValidationErrors is a collection of validation errors.
func (ValidationErrors) Error ¶
func (e ValidationErrors) Error() string
Error implements the error interface.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
identityprovider
Package identityprovider provides authentication identity information from auth handlers.
|
Package identityprovider provides authentication identity information from auth handlers. |
|
secretprovider
Package secretprovider implements a resolver provider for accessing encrypted secrets.
|
Package secretprovider implements a resolver provider for accessing encrypted secrets. |
|
Package detail provides shared business logic for building structured provider information.
|
Package detail provides shared business logic for building structured provider information. |
|
Package schemahelper provides ergonomic builder functions for constructing jsonschema.Schema objects used in provider descriptors.
|
Package schemahelper provides ergonomic builder functions for constructing jsonschema.Schema objects used in provider descriptors. |