Documentation
¶
Index ¶
- func RecipeConfiguration(jsonSchema map[string]any) (*structpb.Struct, error)
- func ValidatePluginPolicy(policyDoc vtypes.PluginPolicy, spec *rtypes.RecipeSchema) error
- func WithMigrations[T any](logger *logrus.Logger, pool *pgxpool.Pool, constructor func(*pgxpool.Pool) T, ...) (T, error)
- type MigrationManager
- type Spec
- type Unimplemented
- func (*Unimplemented) GetPluginID() string
- func (*Unimplemented) GetRecipeSpecification() (*rtypes.RecipeSchema, error)
- func (*Unimplemented) GetSkills() string
- func (*Unimplemented) Suggest(_ context.Context, _ map[string]any) (*rtypes.PolicySuggest, error)
- func (*Unimplemented) ValidatePluginPolicy(_ types.PluginPolicy) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecipeConfiguration ¶
func ValidatePluginPolicy ¶
func ValidatePluginPolicy(policyDoc vtypes.PluginPolicy, spec *rtypes.RecipeSchema) error
func WithMigrations ¶
func WithMigrations[T any]( logger *logrus.Logger, pool *pgxpool.Pool, constructor func(*pgxpool.Pool) T, migrationsDir string, ) (T, error)
WithMigrations runs plugin database migrations and returns an initialized storage instance. This function is designed for use by external plugin applications (e.g., app-recurring) that need to initialize their plugin databases with the required schema.
Example usage in external applications:
safetyStorage, err := plugin.WithMigrations(
logger,
pgPool,
safety_pg.NewRepo,
"safety/safety_pg/migrations",
)
The migrations are embedded in pluginMigrations and executed via MigrationManager.Migrate(). Note: This function is not used within the verifier codebase itself, which uses SystemMigrationManager and VerifierMigrationManager for its own database migrations.
Types ¶
type MigrationManager ¶
type MigrationManager struct {
// contains filtered or unexported fields
}
MigrationManager handles plugin-specific migrations
func NewMigrationManager ¶
func (*MigrationManager) Migrate ¶
func (m *MigrationManager) Migrate() error
type Spec ¶
type Spec interface {
GetRecipeSpecification() (*rtypes.RecipeSchema, error)
ValidatePluginPolicy(policyDoc types.PluginPolicy) error
// Suggest generates policy suggestions based on configuration.
// Context is required as implementations may make RPC calls to external services.
Suggest(ctx context.Context, configuration map[string]any) (*rtypes.PolicySuggest, error)
// GetPluginID returns the unique identifier for this plugin.
GetPluginID() string
// GetSkills returns markdown describing the plugin's capabilities for AI agents.
GetSkills() string
}
type Unimplemented ¶
type Unimplemented struct {
}
Unimplemented for backward compatibility in the case of new interface methods
func (*Unimplemented) GetPluginID ¶ added in v0.1.20
func (*Unimplemented) GetPluginID() string
func (*Unimplemented) GetRecipeSpecification ¶
func (*Unimplemented) GetRecipeSpecification() (*rtypes.RecipeSchema, error)
func (*Unimplemented) GetSkills ¶ added in v0.1.20
func (*Unimplemented) GetSkills() string
func (*Unimplemented) Suggest ¶
func (*Unimplemented) Suggest(_ context.Context, _ map[string]any) (*rtypes.PolicySuggest, error)
func (*Unimplemented) ValidatePluginPolicy ¶
func (*Unimplemented) ValidatePluginPolicy(_ types.PluginPolicy) error