Documentation
¶
Overview ¶
Package types provides shared type definitions used across the starmap packages.
This package contains fundamental types like SourceID and ResourceType that are referenced by multiple packages (sources, provenance, reconciler, etc.) to avoid import cycles while maintaining type safety.
The package has zero dependencies and serves as a foundation for the type system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceType ¶
type ResourceType string
ResourceType identifies the type of resource being tracked or merged in the catalog system. This allows provenance tracking and reconciliation to handle different resource types (models, providers, authors) with appropriate logic.
const ( // ResourceTypeModel represents a model resource (e.g., gpt-4, claude-3). ResourceTypeModel ResourceType = "model" // ResourceTypeProvider represents a provider resource (e.g., openai, anthropic). ResourceTypeProvider ResourceType = "provider" // ResourceTypeAuthor represents an author resource (e.g., openai, meta). ResourceTypeAuthor ResourceType = "author" )
func (ResourceType) String ¶
func (rt ResourceType) String() string
String returns the string representation of a resource type.
type SourceID ¶
type SourceID string
SourceID identifies a data source in the synchronization pipeline. It uniquely identifies where catalog data originates from (providers, models.dev, local files, etc.).
const ( // ProvidersID identifies the provider API source (OpenAI, Anthropic, etc.). ProvidersID SourceID = "providers" // ModelsDevGitID identifies the models.dev Git repository source. ModelsDevGitID SourceID = "models_dev_git" // ModelsDevHTTPID identifies the models.dev HTTP API source. ModelsDevHTTPID SourceID = "models_dev_http" // LocalCatalogID identifies the local filesystem catalog source. LocalCatalogID SourceID = "local_catalog" )
Common source identifiers used throughout the system.
func SourceIDs ¶
func SourceIDs() []SourceID
SourceIDs returns all available source identifiers. This provides a convenient way to iterate over all defined source IDs.