Documentation
¶
Index ¶
- type ChangePublisher
- type Listener
- type Notifier
- type Option
- type Registry
- func (r *Registry) Document() map[string]any
- func (r *Registry) Handler() router.HandlerFunc
- func (r *Registry) Register(provider router.MetadataProvider)
- func (r *Registry) RegisterAll(providers ...router.MetadataProvider)
- func (r *Registry) Resources() []string
- func (r *Registry) Subscribe(listener Listener)
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePublisher ¶
type ChangePublisher interface {
Notify(ctx context.Context, actorID uuid.UUID, metadata map[string]any)
}
ChangePublisher adapts schema change notifications to external systems (e.g., websockets, message buses, webhook fan-out).
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier provides a simple observer pattern so validation listeners can trigger schema refreshes in admin consumers.
type Option ¶
type Option func(*Registry)
Option customizes registry behaviour.
func WithInfo ¶
func WithInfo(info router.OpenAPIInfo) Option
WithInfo overrides the default OpenAPI info metadata.
func WithPublisher ¶
func WithPublisher(publisher ChangePublisher) Option
WithPublisher wires a publisher used to notify listeners outside the process (e.g., websocket hubs) whenever schemas change.
func WithRelationProvider ¶
func WithRelationProvider(provider router.RelationMetadataProvider) Option
WithRelationProvider configures a custom relation metadata provider for the generated documents.
func WithUISchemaOptions ¶
func WithUISchemaOptions(opts router.UISchemaOptions) Option
WithUISchemaOptions applies UI-specific schema enrichment callbacks.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry tracks controller metadata so go-users can expose an aggregated schema endpoint and publish change events to downstream consumers.
func NewRegistry ¶
NewRegistry constructs a registry with optional configuration.
func (*Registry) Document ¶
Document compiles the currently registered providers into a single OpenAPI document. Nil is returned when no providers are registered yet.
func (*Registry) Handler ¶
func (r *Registry) Handler() router.HandlerFunc
Handler returns a go-router handler that serves the aggregated schema document from the `/admin/schemas` endpoint (or any route the caller chooses).
func (*Registry) Register ¶
func (r *Registry) Register(provider router.MetadataProvider)
Register adds a metadata provider to the registry. Subsequent registrations with the same resource name replace the previous snapshot.
func (*Registry) RegisterAll ¶
func (r *Registry) RegisterAll(providers ...router.MetadataProvider)
RegisterAll is a convenience helper that registers multiple providers.