Versions in this module Expand all Collapse all v1 v1.0.2 Dec 8, 2025 Changes in this version + const ProtocolMajor + const ProtocolMinor + const ProtocolPatch + const ProtocolVersion + var ErrBackendUnavailable = errors.New("backend unavailable") + var ErrChecksumMismatch = errors.New("schema checksum mismatch") + var ErrIncompatibleVersion = errors.New("incompatible protocol version") + var ErrInvalidLocation = errors.New("invalid schema location") + var ErrInvalidManifest = errors.New("invalid manifest format") + var ErrInvalidSchema = errors.New("invalid schema format") + var ErrManifestNotFound = errors.New("schema manifest not found") + var ErrProviderNotFound = errors.New("schema provider not found") + var ErrRegistryNotConfigured = errors.New("schema registry not configured") + var ErrSchemaFetchFailed = errors.New("failed to fetch schema") + var ErrSchemaNotFound = errors.New("schema not found") + var ErrSchemaToLarge = errors.New("schema exceeds size limit") + var ErrUnsupportedType = errors.New("unsupported schema type") + var ErrValidationFailed = errors.New("schema validation failed") + func CalculateManifestChecksum(manifest *SchemaManifest) (string, error) + func CalculateSchemaChecksum(schema any) (string, error) + func HasProvider(schemaType SchemaType) bool + func IsCompatible(manifestVersion string) bool + func RegisterProvider(provider SchemaProvider) + func TestConflictStrategy_String(t *testing.T) + func ValidateInstanceMetadata(im *InstanceMetadata) error + func ValidateRoutingConfig(rc *RoutingConfig) error + func ValidateSchemaDescriptor(sd *SchemaDescriptor) error + type AccessRule struct + AllowAnonymous bool + Methods []string + Path string + Permissions []string + Roles []string + type Application interface + Name func() string + Routes func() any + Version func() string + type AsyncAPIMetadata struct + ChannelBindings map[string]any + MessageBindings map[string]any + Protocol string + type AuthConfig struct + AccessControl []AccessRule + PublicRoutes []string + RequiredScopes []string + Schemes []AuthScheme + TokenValidationURL string + type AuthScheme struct + Config map[string]any + Type AuthType + type AuthType string + const AuthTypeAPIKey + const AuthTypeBasic + const AuthTypeBearer + const AuthTypeCustom + const AuthTypeMTLS + const AuthTypeOAuth2 + const AuthTypeOIDC + func (at AuthType) String() string + type BaseSchemaProvider struct + func (p *BaseSchemaProvider) ContentType() string + func (p *BaseSchemaProvider) Endpoint() string + func (p *BaseSchemaProvider) Hash(schema any) (string, error) + func (p *BaseSchemaProvider) Serialize(schema any) ([]byte, error) + func (p *BaseSchemaProvider) SpecVersion() string + func (p *BaseSchemaProvider) Type() SchemaType + func (p *BaseSchemaProvider) Validate(schema any) error + type BreakingChange struct + Description string + Migration string + Path string + Severity ChangeSeverity + Type ChangeType + type Capability string + const CapabilityAMQP + const CapabilityGRPC + const CapabilityGraphQL + const CapabilityMQTT + const CapabilityREST + const CapabilitySSE + const CapabilityWebSocket + func (c Capability) String() string + type ChangeSeverity string + const SeverityCritical + const SeverityHigh + const SeverityLow + const SeverityMedium + func (cs ChangeSeverity) String() string + type ChangeType string + const ChangeTypeEndpointChanged + const ChangeTypeEndpointRemoved + const ChangeTypeEnumValueRemoved + const ChangeTypeFieldRemoved + const ChangeTypeFieldRequired + const ChangeTypeFieldTypeChanged + const ChangeTypeMethodRemoved + func (ct ChangeType) String() string + type CommunicationRoute struct + AuthRequired bool + Description string + ID string + Idempotent bool + Method string + Path string + RequestSchema any + ResponseSchema any + Timeout string + Type CommunicationRouteType + type CommunicationRouteType string + const RouteTypeAdmin + const RouteTypeConfigQuery + const RouteTypeConfigUpdate + const RouteTypeControl + const RouteTypeCustom + const RouteTypeEventAck + const RouteTypeEventPoll + const RouteTypeHealthCheck + const RouteTypeLifecycleReload + const RouteTypeLifecycleStart + const RouteTypeLifecycleStop + const RouteTypeManagement + const RouteTypeMetricsQuery + const RouteTypeSchemaQuery + const RouteTypeSchemaValidate + const RouteTypeStatusQuery + const RouteTypeTracingExport + func (crt CommunicationRouteType) String() string + type CompatibilityMode string + const CompatibilityBackward + const CompatibilityBackwardTransitive + const CompatibilityForward + const CompatibilityForwardTransitive + const CompatibilityFull + const CompatibilityNone + func (cm CompatibilityMode) String() string + type CompositionConfig struct + ComponentPrefix string + ConflictStrategy ConflictStrategy + CustomServers []OpenAPIServer + IncludeInMerged bool + OperationIDPrefix string + PreserveExtensions bool + TagPrefix string + type ConflictStrategy string + const ConflictStrategyError + const ConflictStrategyMerge + const ConflictStrategyOverwrite + const ConflictStrategyPrefix + const ConflictStrategySkip + func (cs ConflictStrategy) String() string + type DataSensitivity string + const SensitivityConfidential + const SensitivityInternal + const SensitivityPCI + const SensitivityPHI + const SensitivityPII + const SensitivityPublic + func (ds DataSensitivity) String() string + type DeploymentMetadata struct + DeployedAt int64 + DeploymentID string + Stage string + Strategy DeploymentStrategy + TrafficPercent int + type DeploymentStrategy string + const DeploymentStrategyBlueGreen + const DeploymentStrategyCanary + const DeploymentStrategyRecreate + const DeploymentStrategyRolling + const DeploymentStrategyShadow + func (ds DeploymentStrategy) String() string + type Deprecation struct + DeprecatedAt string + Migration string + Path string + Reason string + RemovalDate string + Replacement string + type EventType string + const EventTypeAdded + const EventTypeRemoved + const EventTypeUpdated + func (et EventType) String() string + type FederatedEntity struct + Fields []string + KeyFields []string + Resolvable bool + TypeName string + type FetchOptions struct + ExpectedHash string + Timeout int64 + UseCache bool + ValidateChecksum bool + type GRPCMetadata struct + BidirectionalStreamingEnabled bool + ClientStreamingEnabled bool + GRPCWebEnabled bool + GRPCWebProtocol string + Packages []string + ReflectionEnabled bool + ServerStreamingEnabled bool + Services []string + type GraphQLFederation struct + Entities []FederatedEntity + Extends []string + Provides []ProvidesRelation + Requires []RequiresRelation + SubgraphName string + Version string + type GraphQLMetadata struct + ComplexityLimit int + DepthLimit int + Federation *GraphQLFederation + SubscriptionProtocol string + SubscriptionsEnabled bool + type HTTPCommunicationRoutes struct + GatewayRoutes []CommunicationRoute + Polling *PollingConfig + ServiceRoutes []CommunicationRoute + type InstanceMetadata struct + Address string + Deployment *DeploymentMetadata + ExpectedSchemaChecksum string + Labels map[string]string + Region string + Role InstanceRole + StartedAt int64 + Status InstanceStatus + Weight int + Zone string + type InstanceRole string + const InstanceRoleBlue + const InstanceRoleCanary + const InstanceRoleGreen + const InstanceRolePrimary + const InstanceRoleShadow + func (ir InstanceRole) String() string + type InstanceStatus string + const InstanceStatusDegraded + const InstanceStatusDraining + const InstanceStatusHealthy + const InstanceStatusStarting + const InstanceStatusStopping + const InstanceStatusUnhealthy + func (is InstanceStatus) String() string + type LatencyProfile struct + P50 string + P95 string + P99 string + P999 string + type LocationType string + const LocationTypeHTTP + const LocationTypeInline + const LocationTypeRegistry + func (lt LocationType) IsValid() bool + func (lt LocationType) String() string + type ManifestChangeHandler func(event *ManifestEvent) + type ManifestDiff struct + CapabilitiesAdded []string + CapabilitiesRemoved []string + EndpointsChanged bool + SchemasAdded []SchemaDescriptor + SchemasChanged []SchemaChangeDiff + SchemasRemoved []SchemaDescriptor + func DiffManifests(old, newManifest *SchemaManifest) *ManifestDiff + func (d *ManifestDiff) HasChanges() bool + type ManifestError struct + Err error + InstanceID string + ServiceName string + func (e *ManifestError) Error() string + func (e *ManifestError) Unwrap() error + type ManifestEvent struct + Manifest *SchemaManifest + Timestamp int64 + Type EventType + type ManifestStorage struct + func NewManifestStorage(backend StorageBackend, namespace string, compressionThreshold int64, ...) *ManifestStorage + func (s *ManifestStorage) Delete(ctx context.Context, serviceName, instanceID string) error + func (s *ManifestStorage) DeleteSchema(ctx context.Context, path string) error + func (s *ManifestStorage) Get(ctx context.Context, serviceName, instanceID string) (*SchemaManifest, error) + func (s *ManifestStorage) GetSchema(ctx context.Context, path string) (any, error) + func (s *ManifestStorage) List(ctx context.Context, serviceName string) ([]*SchemaManifest, error) + func (s *ManifestStorage) Put(ctx context.Context, manifest *SchemaManifest) error + func (s *ManifestStorage) PutSchema(ctx context.Context, path string, schema any) error + type MountStrategy string + const MountStrategyCustom + const MountStrategyInstance + const MountStrategyRoot + const MountStrategyService + const MountStrategySubdomain + const MountStrategyVersioned + func (ms MountStrategy) IsValid() bool + func (ms MountStrategy) String() string + type ORPCMetadata struct + BatchEnabled bool + StreamingProcedures []string + type OpenAPIMetadata struct + Composition *CompositionConfig + DefaultSecurity []string + Extensions map[string]any + ServerVariables map[string]ServerVariable + type OpenAPIServer struct + Description string + URL string + Variables map[string]ServerVariable + type PathRewrite struct + Pattern string + Replacement string + type PollingConfig struct + Interval string + LongPolling bool + LongPollingTimeout string + Timeout string + type ProtocolMetadata struct + AsyncAPI *AsyncAPIMetadata + GRPC *GRPCMetadata + GraphQL *GraphQLMetadata + ORPC *ORPCMetadata + OpenAPI *OpenAPIMetadata + type ProviderRegistry struct + func NewProviderRegistry() *ProviderRegistry + func (r *ProviderRegistry) Get(schemaType SchemaType) (SchemaProvider, bool) + func (r *ProviderRegistry) Has(schemaType SchemaType) bool + func (r *ProviderRegistry) List() []SchemaType + func (r *ProviderRegistry) Register(provider SchemaProvider) + type ProvidesRelation struct + Field string + Fields []string + type PublishOptions struct + Compress bool + OverwriteExisting bool + TTL int64 + type RegistryConfig struct + Backend string + BackendConfig map[string]any + CompressionThreshold int64 + MaxSchemaSize int64 + Namespace string + TTL int64 + func DefaultRegistryConfig() RegistryConfig + type RequiresRelation struct + Field string + Fields []string + type RetryConfig struct + InitialDelay string + MaxAttempts int + MaxDelay string + Multiplier float64 + type RouteMetadata struct + CacheTTL string + Cacheable bool + Cost int + Idempotent bool + Method string + OperationID string + Path string + RateLimitHint int + ResponseSize SizeHint + Sensitivity DataSensitivity + TimeoutHint string + type RoutingConfig struct + BasePath string + Priority int + Rewrite []PathRewrite + Strategy MountStrategy + StripPrefix bool + Subdomain string + Tags []string + type ScalingProfile struct + AutoScale bool + MaxInstances int + MinInstances int + TargetCPU float64 + TargetMemory float64 + type SchemaCache interface + Clear func() error + Delete func(hash string) error + Get func(hash string) (any, bool) + Set func(hash string, schema any) error + Size func() int + type SchemaChangeDiff struct + NewHash string + OldHash string + Type SchemaType + type SchemaChangeHandler func(event *SchemaEvent) + type SchemaCompatibility struct + BreakingChanges []BreakingChange + Deprecations []Deprecation + Mode CompatibilityMode + PreviousVersions []string + type SchemaDescriptor struct + Compatibility *SchemaCompatibility + ContentType string + Hash string + InlineSchema any + Location SchemaLocation + Metadata *ProtocolMetadata + Size int64 + SpecVersion string + Type SchemaType + type SchemaEndpoints struct + AsyncAPI string + GRPCReflection bool + GraphQL string + Health string + Metrics string + OpenAPI string + type SchemaError struct + Err error + Path string + Type SchemaType + func (e *SchemaError) Error() string + func (e *SchemaError) Unwrap() error + type SchemaEvent struct + Path string + Schema any + Timestamp int64 + Type EventType + type SchemaLocation struct + Headers map[string]string + RegistryPath string + Type LocationType + URL string + func (sl *SchemaLocation) Validate() error + type SchemaManifest struct + Auth AuthConfig + Capabilities []string + Checksum string + Endpoints SchemaEndpoints + Hints *ServiceHints + Instance *InstanceMetadata + InstanceID string + Routing RoutingConfig + Schemas []SchemaDescriptor + ServiceName string + ServiceVersion string + UpdatedAt int64 + Version string + Webhook WebhookConfig + func FromJSON(data []byte) (*SchemaManifest, error) + func NewManifest(serviceName, serviceVersion, instanceID string) *SchemaManifest + func (m *SchemaManifest) AddCapability(capability string) + func (m *SchemaManifest) AddSchema(descriptor SchemaDescriptor) + func (m *SchemaManifest) Clone() *SchemaManifest + func (m *SchemaManifest) GetSchema(schemaType SchemaType) (*SchemaDescriptor, bool) + func (m *SchemaManifest) HasCapability(capability string) bool + func (m *SchemaManifest) ToJSON() ([]byte, error) + func (m *SchemaManifest) ToPrettyJSON() ([]byte, error) + func (m *SchemaManifest) UpdateChecksum() error + func (m *SchemaManifest) Validate() error + type SchemaProvider interface + ContentType func() string + Endpoint func() string + Generate func(ctx context.Context, app Application) (any, error) + Hash func(schema any) (string, error) + Serialize func(schema any) ([]byte, error) + SpecVersion func() string + Type func() SchemaType + Validate func(schema any) error + func GetProvider(schemaType SchemaType) (SchemaProvider, bool) + type SchemaRegistry interface + Close func() error + DeleteManifest func(ctx context.Context, instanceID string) error + DeleteSchema func(ctx context.Context, path string) error + FetchSchema func(ctx context.Context, path string) (any, error) + GetManifest func(ctx context.Context, instanceID string) (*SchemaManifest, error) + Health func(ctx context.Context) error + ListManifests func(ctx context.Context, serviceName string) ([]*SchemaManifest, error) + PublishSchema func(ctx context.Context, path string, schema any) error + RegisterManifest func(ctx context.Context, manifest *SchemaManifest) error + UpdateManifest func(ctx context.Context, manifest *SchemaManifest) error + WatchManifests func(ctx context.Context, serviceName string, onChange ManifestChangeHandler) error + WatchSchemas func(ctx context.Context, path string, onChange SchemaChangeHandler) error + type SchemaType string + const SchemaTypeAsyncAPI + const SchemaTypeAvro + const SchemaTypeCustom + const SchemaTypeGRPC + const SchemaTypeGraphQL + const SchemaTypeORPC + const SchemaTypeOpenAPI + const SchemaTypeThrift + func ListProviders() []SchemaType + func (st SchemaType) IsValid() bool + func (st SchemaType) String() string + type ServerVariable struct + Default string + Description string + Enum []string + type ServiceDependency struct + Critical bool + SchemaType SchemaType + ServiceName string + UsedOperations []string + VersionRange string + type ServiceHints struct + Dependencies []ServiceDependency + ExpectedLatency *LatencyProfile + RecommendedTimeout string + Scaling *ScalingProfile + type SizeHint string + const SizeLarge + const SizeMedium + const SizeSmall + const SizeXLarge + func (sh SizeHint) String() string + type StorageBackend interface + Close func() error + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) ([]byte, error) + List func(ctx context.Context, prefix string) ([]string, error) + Put func(ctx context.Context, key string, value []byte) error + Watch func(ctx context.Context, prefix string) (<-chan StorageEvent, error) + type StorageEvent struct + Key string + Type EventType + Value []byte + type StorageHelper struct + func NewStorageHelper(backend StorageBackend, compressionThreshold, maxSize int64) *StorageHelper + func (h *StorageHelper) GetJSON(ctx context.Context, key string, target any) error + func (h *StorageHelper) PutJSON(ctx context.Context, key string, value any) error + type ValidationError struct + Field string + Message string + func (e *ValidationError) Error() string + type VersionInfo struct + Major int + Minor int + Patch int + Version string + func GetVersion() VersionInfo + type WebhookConfig struct + GatewayWebhook string + HTTPRoutes *HTTPCommunicationRoutes + PublishEvents []WebhookEventType + Retry RetryConfig + Secret string + ServiceWebhook string + SubscribeEvents []WebhookEventType + type WebhookEventType string + const EventCircuitBreakerClosed + const EventCircuitBreakerOpen + const EventConfigUpdated + const EventHealthChanged + const EventInstanceScaling + const EventMaintenanceMode + const EventRateLimitChanged + const EventSchemaUpdated + const EventTrafficShift + func (wet WebhookEventType) String() string v1.0.1 Nov 5, 2025 v1.0.0 Nov 5, 2025