Documentation
¶
Index ¶
- Constants
- Variables
- func DatastoreSpec() (*datastore.Spec, error)
- func NewCatalogArtifactEntityMappings() filter.EntityMappingFunctions
- func NewCatalogArtifactRepository(db *gorm.DB, artifactTypes datastore.ArtifactTypeMap) models.CatalogArtifactRepository
- func NewCatalogSourceRepository(db *gorm.DB, typeID int32) models.CatalogSourceRepository
- func NewPropertyOptionsRepository(db *gorm.DB) models.PropertyOptionsRepository
- type CatalogArtifactRepositoryImpl
- func (r *CatalogArtifactRepositoryImpl) CountByParentIDs(parentIDs []int32) (map[int32]map[string]int32, error)
- func (r *CatalogArtifactRepositoryImpl) DeleteByParentID(artifactTypeName string, parentResourceID int32) error
- func (r *CatalogArtifactRepositoryImpl) GetByID(id int32) (models.CatalogArtifact, error)
- func (r *CatalogArtifactRepositoryImpl) List(listOptions models.CatalogArtifactListOptions) (*dbmodels.ListWrapper[models.CatalogArtifact], error)
- type CatalogSourceRepositoryImpl
- func (r *CatalogSourceRepositoryImpl) Delete(sourceID string) error
- func (r *CatalogSourceRepositoryImpl) GetAll() ([]models.CatalogSource, error)
- func (r *CatalogSourceRepositoryImpl) GetAllStatuses() (map[string]models.SourceStatus, error)
- func (r *CatalogSourceRepositoryImpl) GetBySourceID(sourceID string) (models.CatalogSource, error)
- func (r *CatalogSourceRepositoryImpl) Save(source models.CatalogSource) (models.CatalogSource, error)
- type PropertyOptionsRepositoryImpl
Constants ¶
const ( CatalogModelTypeName = "kf.CatalogModel" CatalogModelArtifactTypeName = "kf.CatalogModelArtifact" CatalogMetricsArtifactTypeName = "kf.CatalogMetricsArtifact" CatalogSourceTypeName = "kf.CatalogSource" MCPServerTypeName = "kf.MCPServer" MCPServerToolTypeName = "kf.MCPServerTool" )
Variables ¶
var ErrCatalogArtifactNotFound = errors.New("catalog artifact by id not found")
var ErrCatalogSourceNotFound = errors.New("catalog source not found")
Functions ¶
func DatastoreSpec ¶
func NewCatalogArtifactEntityMappings ¶ added in v0.3.10
func NewCatalogArtifactEntityMappings() filter.EntityMappingFunctions
func NewCatalogArtifactRepository ¶
func NewCatalogArtifactRepository(db *gorm.DB, artifactTypes datastore.ArtifactTypeMap) models.CatalogArtifactRepository
func NewCatalogSourceRepository ¶
func NewCatalogSourceRepository(db *gorm.DB, typeID int32) models.CatalogSourceRepository
NewCatalogSourceRepository creates a new CatalogSourceRepository.
func NewPropertyOptionsRepository ¶
func NewPropertyOptionsRepository(db *gorm.DB) models.PropertyOptionsRepository
Types ¶
type CatalogArtifactRepositoryImpl ¶
type CatalogArtifactRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*CatalogArtifactRepositoryImpl) CountByParentIDs ¶ added in v0.3.11
func (r *CatalogArtifactRepositoryImpl) CountByParentIDs(parentIDs []int32) (map[int32]map[string]int32, error)
CountByParentIDs returns artifact counts grouped by category for each parent model. The outer map key is the parent model ID (context_id from Attribution). The inner map key is the artifact category: "model-artifact" for CatalogModelArtifacts, or the metricsType value ("performance-metrics", "accuracy-metrics", etc.) for CatalogMetricsArtifacts. Categories with zero count are omitted from the inner map. Parents with no artifacts have no entry in the outer map.
func (*CatalogArtifactRepositoryImpl) DeleteByParentID ¶
func (r *CatalogArtifactRepositoryImpl) DeleteByParentID(artifactTypeName string, parentResourceID int32) error
func (*CatalogArtifactRepositoryImpl) GetByID ¶
func (r *CatalogArtifactRepositoryImpl) GetByID(id int32) (models.CatalogArtifact, error)
func (*CatalogArtifactRepositoryImpl) List ¶
func (r *CatalogArtifactRepositoryImpl) List(listOptions models.CatalogArtifactListOptions) (*dbmodels.ListWrapper[models.CatalogArtifact], error)
List retrieves catalog artifacts with support for filtering, pagination, and custom property ordering.
The method handles ordering in the following priority: 1. NAME - Special catalog-specific ordering 2. Standard columns (ID, CREATE_TIME, LAST_UPDATE_TIME) - Uses allowed column map 3. Custom properties (e.g., accuracy.double_value) - Dynamic property-based ordering 4. Fallback to ID ordering for invalid or unrecognized inputs
type CatalogSourceRepositoryImpl ¶
type CatalogSourceRepositoryImpl struct {
// contains filtered or unexported fields
}
CatalogSourceRepositoryImpl implements CatalogSourceRepository using GORM.
func (*CatalogSourceRepositoryImpl) Delete ¶
func (r *CatalogSourceRepositoryImpl) Delete(sourceID string) error
Delete removes a catalog source by its source ID.
func (*CatalogSourceRepositoryImpl) GetAll ¶
func (r *CatalogSourceRepositoryImpl) GetAll() ([]models.CatalogSource, error)
GetAll retrieves all catalog sources.
func (*CatalogSourceRepositoryImpl) GetAllStatuses ¶
func (r *CatalogSourceRepositoryImpl) GetAllStatuses() (map[string]models.SourceStatus, error)
GetAllStatuses returns a map of source ID to status/error for all sources.
func (*CatalogSourceRepositoryImpl) GetBySourceID ¶
func (r *CatalogSourceRepositoryImpl) GetBySourceID(sourceID string) (models.CatalogSource, error)
GetBySourceID retrieves a catalog source by its source ID.
func (*CatalogSourceRepositoryImpl) Save ¶
func (r *CatalogSourceRepositoryImpl) Save(source models.CatalogSource) (models.CatalogSource, error)
Save creates or updates a catalog source.
type PropertyOptionsRepositoryImpl ¶
type PropertyOptionsRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*PropertyOptionsRepositoryImpl) List ¶
func (r *PropertyOptionsRepositoryImpl) List(t models.PropertyOptionType, typeID int32) ([]models.PropertyOption, error)
func (*PropertyOptionsRepositoryImpl) Refresh ¶
func (r *PropertyOptionsRepositoryImpl) Refresh(t models.PropertyOptionType) error