Documentation
¶
Overview ¶
Package plugin defines the hook surfaces and the ordered registry.
v1 plugins are compile-time: a plugin is any Go type implementing one or more of the hook interfaces below, registered via Register (built-ins) or pdbq.WithPlugins (library embedding). The interfaces are deliberately small and orthogonal — they are also the contract for a future out-of-process (go-plugin / wasm) transport.
Index ¶
- func Register(p Plugin)
- type CatalogHook
- type CompileHook
- type InflectionHook
- type Plugin
- type Registry
- func (r *Registry) CompileChain(disabled map[string]bool, base compile.Func) compile.Func
- func (r *Registry) Inflector(disabled map[string]bool) inflect.Next
- func (r *Registry) RequestHooks(disabled map[string]bool) []RequestHook
- func (r *Registry) TransformSchema(ctx context.Context, disabled map[string]bool, b *schema.Builder) error
- type RequestHook
- type SchemaHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CatalogHook ¶
type CatalogHook = plugin.CatalogHook
CatalogHook mutates or filters the introspected catalog before schema building (e.g. hide tables, rename via comments).
type CompileHook ¶
CompileHook wraps SQL generation per field, middleware-style.
type InflectionHook ¶
type InflectionHook = plugin.InflectionHook
InflectionHook controls every generated GraphQL name. Call next to get the downstream (ultimately default) name; return your own to override.
type Plugin ¶
Plugin is the base interface: identity plus default priority. Lower priority runs earlier (outermost in middleware chains); ties break by registration order.
type Registry ¶
Registry holds plugins in deterministic order. The generic half (ordering, CatalogHook, InflectionHook) is pdbcore's; this wrapper adds the GraphQL-typed hook chains.
func NewRegistry ¶
func (*Registry) CompileChain ¶
CompileChain wraps base with all CompileHooks (outermost = lowest priority).
func (*Registry) Inflector ¶
Inflector composes all InflectionHooks into a single naming function with inflect.Default as the innermost link.
func (*Registry) RequestHooks ¶
func (r *Registry) RequestHooks(disabled map[string]bool) []RequestHook
RequestHooks returns the RequestHook implementations in order.