authority

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package authority manages source authority for catalog data reconciliation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchesPattern

func MatchesPattern(fieldPath, pattern string) bool

MatchesPattern checks if a field path matches a pattern (supports * wildcards).

Types

type Authority

type Authority interface {
	// Find returns the authority configuration for a specific field
	Find(resourceType sources.ResourceType, fieldPath string) *Field

	// List returns all authorities for a resource type
	ModelFields() []Field
	ProviderFields() []Field
	AuthorFields() []Field
}

Authority determines which source is authoritative for each field.

func New

func New() Authority

New creates a new DefaultAuthorities with standard configurations.

type Field

type Field struct {
	Path     string     `json:"path" yaml:"path"`         // e.g., "pricing.input", "metadata.knowledge_cutoff"
	Source   sources.ID `json:"source" yaml:"source"`     // Which source is authoritative
	Priority int        `json:"priority" yaml:"priority"` // Priority (higher = more authoritative)
}

Field defines source priority for a specific field.

Jump to

Keyboard shortcuts

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