registry

package
v2.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package registry stores definition registrations for the greenfield integration runtime

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDefinitionIDRequired indicates a definition is missing its canonical identifier
	ErrDefinitionIDRequired = errors.New("integrations/registry: definition id required")
	// ErrDefinitionAlreadyRegistered indicates the definition ID is already present
	ErrDefinitionAlreadyRegistered = errors.New("integrations/registry: definition already registered")
	// ErrDefinitionNotFound indicates the requested definition does not exist
	ErrDefinitionNotFound = errors.New("integrations/registry: definition not found")
	// ErrClientRequired indicates a client registration is missing its identity
	ErrClientRequired = errors.New("integrations/registry: client required")
	// ErrClientNotFound indicates the requested client does not exist
	ErrClientNotFound = errors.New("integrations/registry: client not found")
	// ErrConnectionCredentialRefRequired indicates a connection registration is missing its credential ref
	ErrConnectionCredentialRefRequired = errors.New("integrations/registry: connection credential ref required")
	// ErrOperationNotFound indicates the requested operation does not exist
	ErrOperationNotFound = errors.New("integrations/registry: operation not found")
	// ErrOperationHandlerRequired indicates an operation registration is missing both Handle and IngestHandle
	ErrOperationHandlerRequired = errors.New("integrations/registry: operation handler required")
	// ErrOperationHandlerAmbiguous indicates an operation registration specifies both Handle and IngestHandle
	ErrOperationHandlerAmbiguous = errors.New("integrations/registry: operation must specify exactly one of Handle or IngestHandle")
	// ErrIngestContractsRequired indicates an IngestHandle is registered without any Ingest contracts
	ErrIngestContractsRequired = errors.New("integrations/registry: IngestHandle requires at least one Ingest contract")
	// ErrWebhookEventResolverRequired indicates a webhook registration is missing its event resolver
	ErrWebhookEventResolverRequired = errors.New("integrations/registry: webhook event resolver required")
	// ErrWebhookEventHandlerRequired indicates a webhook event registration is missing its handler
	ErrWebhookEventHandlerRequired = errors.New("integrations/registry: webhook event handler required")
	// ErrWebhookNotFound indicates the requested webhook or webhook event does not exist
	ErrWebhookNotFound = errors.New("integrations/registry: webhook not found")
	// ErrOperatorConfigSchemaRequired indicates a definition has an operator config with no schema
	ErrOperatorConfigSchemaRequired = errors.New("integrations/registry: operator config schema required")
	// ErrCredentialSchemaRequired indicates a definition has a credentials block with no schema
	ErrCredentialSchemaRequired = errors.New("integrations/registry: credential schema required")
	// ErrCredentialRefNotDeclared indicates a client references a credential ref not declared by the definition
	ErrCredentialRefNotDeclared = errors.New("integrations/registry: client credential ref not declared by definition")
	// ErrConnectionCredentialRefNotDeclared indicates a connection references a credential ref not declared by the definition
	ErrConnectionCredentialRefNotDeclared = errors.New("integrations/registry: connection credential ref not declared by definition")
	// ErrConnectionClientRefNotDeclared indicates a connection references a client ref not declared by the definition
	ErrConnectionClientRefNotDeclared = errors.New("integrations/registry: connection client ref not declared by definition")
	// ErrConnectionValidationOperationNotDeclared indicates a connection validation operation does not exist on the definition
	ErrConnectionValidationOperationNotDeclared = errors.New("integrations/registry: connection validation operation not declared by definition")
	// ErrConnectionAuthCredentialRefNotDeclared indicates a connection auth registration references an undeclared credential ref
	ErrConnectionAuthCredentialRefNotDeclared = errors.New("integrations/registry: connection auth credential ref not declared by connection")
	// ErrConnectionDisconnectCredentialRefNotDeclared indicates a connection disconnect registration references an undeclared credential ref
	ErrConnectionDisconnectCredentialRefNotDeclared = errors.New("integrations/registry: connection disconnect credential ref not declared by connection")
	// ErrUserInputSchemaRequired indicates a definition has a user input block with no schema
	ErrUserInputSchemaRequired = errors.New("integrations/registry: user input schema required")
	// ErrBuilderNil indicates a builder dependency was nil
	ErrBuilderNil = errors.New("integrations/registry: builder is nil")
	// ErrRuntimeBuildRequired indicates a runtime integration registration is missing its Build function
	ErrRuntimeBuildRequired = errors.New("integrations/registry: runtime integration build function required")
	// ErrLinkEdgeNotFound indicates a mapping opted into a link edge that does not exist on the source schema
	ErrLinkEdgeNotFound = errors.New("integrations/registry: link edge not found on source schema")
	// ErrLinkEdgeAmbiguous indicates a link rule's target type matches multiple edges and no edge name was set
	ErrLinkEdgeAmbiguous = errors.New("integrations/registry: link target type is ambiguous, edge name required")
	// ErrLinkRuleInvalid indicates a link rule sets neither or both of a field match and an expression
	ErrLinkRuleInvalid = errors.New("integrations/registry: link rule must set exactly one of field match or expression")
	// ErrLinkTargetNotRegistered indicates a link rule's edge targets a schema without a registry entry
	ErrLinkTargetNotRegistered = errors.New("integrations/registry: link edge target schema is not in the entityops registry")
	// ErrLinkTargetFieldInvalid indicates a link rule's target field is not a match key on the target schema
	ErrLinkTargetFieldInvalid = errors.New("integrations/registry: link target field is not a match key on the target schema")
	// ErrLinkSourceFieldInvalid indicates a link rule's source field is not a mapped input key of the required shape
	ErrLinkSourceFieldInvalid = errors.New("integrations/registry: link source field is not a mapped input key of the required shape")
)

Functions

func ResolveLinkEdge

func ResolveLinkEdge(sourceSchema *entityops.Schema, rule types.LinkRule) (entityops.EdgeDescriptor, error)

ResolveLinkEdge resolves the edge a link rule links through: an explicit rule edge is looked up by name and checked against the declared target type; otherwise the target type must identify exactly one edge, since silently picking one of several (e.g. editors vs viewers, both targeting Group) would link through an arbitrary edge

func ValidateLinkRules

func ValidateLinkRules(sourceSchema *entityops.Schema, rules []types.LinkRule) error

ValidateLinkRules validates each rule against the source schema's catalog: the edge resolves unambiguously, the match shape is coherent, and the referenced fields exist with the right shape. It is shared by definition registration and installation config validation so a bad rule fails at declaration or save time rather than at ingest

Types

type Builder

type Builder func() (types.Definition, error)

Builder builds one manifest-backed definition

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is the in-memory index of registered definitions. Built once at startup via RegisterAll; all state is read-only after construction

func New

func New() *Registry

New constructs an empty registry

func (*Registry) Catalog

func (r *Registry) Catalog() []types.DefinitionSpec

Catalog returns all definition specs in stable id order

func (*Registry) Client

func (r *Registry) Client(id string, clientID types.ClientID) (types.ClientRegistration, error)

Client returns one client registration for a definition

func (*Registry) Definition

func (r *Registry) Definition(id string) (types.Definition, bool)

Definition returns one definition by canonical identifier

func (*Registry) Definitions

func (r *Registry) Definitions() []types.Definition

Definitions returns all registered definitions in stable id order

func (*Registry) GalaListeners

func (r *Registry) GalaListeners() []types.GalaListenerRegistration

GalaListeners returns all registered standalone gala listener registrations

func (*Registry) IsRuntimeIntegration

func (r *Registry) IsRuntimeIntegration(definitionID string) bool

IsRuntimeIntegration reports whether the given definition was provisioned as a runtime integration (no DB record, no keystore)

func (*Registry) Listeners

func (r *Registry) Listeners() []types.OperationRegistration

Listeners returns all operation registrations in stable topic order

func (*Registry) Operation

func (r *Registry) Operation(id string, name string) (types.OperationRegistration, error)

Operation returns one operation registration for a definition

func (*Registry) Register

func (r *Registry) Register(def types.Definition) error

Register adds one definition to the registry

func (*Registry) RegisterAll

func (r *Registry) RegisterAll(builders ...Builder) error

RegisterAll builds and registers every supplied definition builder in order

func (*Registry) RuntimeClient

func (r *Registry) RuntimeClient(definitionID string) (any, bool)

RuntimeClient returns the cached runtime client for the given definition ID. Returns the client and true if a runtime integration was provisioned, or nil and false otherwise

func (*Registry) StaticWebhooks

func (r *Registry) StaticWebhooks() []types.StaticWebhookEntry

StaticWebhooks returns all webhook registrations that declare a fixed static route

func (*Registry) Webhook

func (r *Registry) Webhook(id string, name string) (types.WebhookRegistration, error)

Webhook returns one webhook registration for a definition

func (*Registry) WebhookEvent

func (r *Registry) WebhookEvent(id string, webhookName string, eventName string) (types.WebhookEventRegistration, error)

WebhookEvent returns one webhook event registration for a definition

func (*Registry) WebhookListeners

func (r *Registry) WebhookListeners() []types.WebhookEventRegistration

WebhookListeners returns all webhook event registrations in stable topic order

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL