Documentation
¶
Overview ¶
Package pluginclient is CVT's core-side glue between pkg/cvt.Hooks and internal/pluginmgr. It translates hook calls into typed plugin RPCs, records metrics + audit, and applies the per-plugin on_error policy.
Core imports this package and injects HooksAdapter wherever pkg/cvt.Hooks is required. pkg/cvt itself stays free of internal/* imports.
Index ¶
- type HooksAdapter
- func (a *HooksAdapter) FetchSchema(ctx context.Context, req *registrypb.FetchSchemaRequest) (*registrypb.FetchSchemaResponse, error)
- func (a *HooksAdapter) OnBreakingChangeDetected(ctx context.Context, req *eventspb.BreakingChangeDetectedRequest) (*eventspb.EventResponse, error)
- func (a *HooksAdapter) OnValidationFailed(ctx context.Context, req *eventspb.ValidationFailedRequest) (*eventspb.EventResponse, error)
- func (a *HooksAdapter) RegisterConsumerUsage(ctx context.Context, req *registrypb.RegisterConsumerUsageRequest) (*registrypb.RegisterConsumerUsageResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HooksAdapter ¶
type HooksAdapter struct {
// contains filtered or unexported fields
}
HooksAdapter implements pkg/cvt.Hooks by dispatching to whichever plugin is bound to each hook in the config. Unbound hooks delegate to cvt.NoopHooks (read hooks return nil, events are no-ops).
func NewHooks ¶
func NewHooks(mgr *pluginmgr.Manager) *HooksAdapter
NewHooks constructs an adapter. The manager's config controls which plugin (if any) handles each hook.
func (*HooksAdapter) FetchSchema ¶
func (a *HooksAdapter) FetchSchema(ctx context.Context, req *registrypb.FetchSchemaRequest) (*registrypb.FetchSchemaResponse, error)
FetchSchema invokes the plugin bound to the fetch_schema hook, if any. Returns (nil, nil) when no plugin is bound — the caller falls back to direct resolution.
func (*HooksAdapter) OnBreakingChangeDetected ¶
func (a *HooksAdapter) OnBreakingChangeDetected(ctx context.Context, req *eventspb.BreakingChangeDetectedRequest) (*eventspb.EventResponse, error)
OnBreakingChangeDetected invokes the plugin bound to on_breaking_change_detected, if any.
func (*HooksAdapter) OnValidationFailed ¶
func (a *HooksAdapter) OnValidationFailed(ctx context.Context, req *eventspb.ValidationFailedRequest) (*eventspb.EventResponse, error)
OnValidationFailed invokes the plugin bound to on_validation_failed.
func (*HooksAdapter) RegisterConsumerUsage ¶
func (a *HooksAdapter) RegisterConsumerUsage(ctx context.Context, req *registrypb.RegisterConsumerUsageRequest) (*registrypb.RegisterConsumerUsageResponse, error)
RegisterConsumerUsage invokes the plugin bound to the register_consumer_usage hook, if any.