models

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringValueField = "string_value"
	DoubleValueField = "double_value"
	IntValueField    = "int_value"
	ArrayValueField  = "array_value"
)

Variables

This section is empty.

Functions

func RegisterArtifactMapper

func RegisterArtifactMapper(typeName string, mapper ArtifactMapperFunc)

RegisterArtifactMapper registers a mapping function for a specific artifact type

Types

type ArtifactMapperFunc

type ArtifactMapperFunc func(artifact schema.Artifact, properties []schema.ArtifactProperty) interface{}

ArtifactMapperFunc defines the signature for artifact mapping functions

func GetArtifactMapper

func GetArtifactMapper(typeName string) (ArtifactMapperFunc, bool)

GetArtifactMapper retrieves a mapping function for a specific artifact type

type CatalogArtifact

type CatalogArtifact struct {
	CatalogModelArtifact   CatalogModelArtifact
	CatalogMetricsArtifact CatalogMetricsArtifact
}

CatalogArtifact is a discriminated union that can hold different catalog artifact types

type CatalogArtifactEntity

type CatalogArtifactEntity interface {
	GetID() *int32
	SetID(int32)
	GetProperties() *[]models.Properties
	GetCustomProperties() *[]models.Properties
}

CatalogArtifactEntity defines the common interface that all catalog artifacts must implement. This allows the shared infrastructure to work with catalog-specific types without import cycles. Note: GetAttributes() is intentionally excluded because concrete types return different typed pointers, which Go's interface matching does not allow.

type CatalogArtifactListOptions

type CatalogArtifactListOptions struct {
	models.Pagination
	Name                *string
	ExternalID          *string
	ParentResourceID    *int32
	ArtifactType        *string
	ArtifactTypesFilter []string
}

func (*CatalogArtifactListOptions) GetRestEntityType

func (c *CatalogArtifactListOptions) GetRestEntityType() dbfilter.RestEntityType

GetRestEntityType implements the FilterApplier interface This enables advanced filtering support for catalog artifacts

type CatalogArtifactRepository

type CatalogArtifactRepository interface {
	GetByID(id int32) (CatalogArtifact, error)
	List(listOptions CatalogArtifactListOptions) (*models.ListWrapper[CatalogArtifact], error)
	DeleteByParentID(artifactType string, parentResourceID int32) error
}

type CatalogMetricsArtifact

type CatalogMetricsArtifact CatalogArtifactEntity

CatalogMetricsArtifact represents the interface for metrics artifacts

type CatalogModelArtifact

type CatalogModelArtifact CatalogArtifactEntity

CatalogModelArtifact represents the interface for model artifacts

type CatalogRestEntityType

type CatalogRestEntityType string

CatalogRestEntityType represents catalog-specific REST API entity types

const (
	RestEntityCatalogModel    CatalogRestEntityType = "CatalogModel"
	RestEntityCatalogArtifact CatalogRestEntityType = "CatalogArtifact"
	RestEntityMCPServer       CatalogRestEntityType = "MCPServer"
	RestEntityMCPServerTool   CatalogRestEntityType = "MCPServerTool"
)

type CatalogSource

type CatalogSource interface {
	models.Entity[CatalogSourceAttributes]
}

CatalogSource represents a catalog source stored in the database.

type CatalogSourceAttributes

type CatalogSourceAttributes struct {
	// Name is the source ID (used as the context name)
	Name *string
	// CreateTimeSinceEpoch is when the record was created
	CreateTimeSinceEpoch *int64
	// LastUpdateTimeSinceEpoch is when the record was last updated
	LastUpdateTimeSinceEpoch *int64
}

CatalogSourceAttributes holds the attributes for a catalog source record.

type CatalogSourceImpl

type CatalogSourceImpl = models.BaseEntity[CatalogSourceAttributes]

CatalogSourceImpl is the concrete implementation of CatalogSource.

type CatalogSourceRepository

type CatalogSourceRepository interface {
	// GetBySourceID retrieves a catalog source by its source ID.
	GetBySourceID(sourceID string) (CatalogSource, error)

	// Save creates or updates a catalog source.
	// The source ID is used as the unique identifier (context name).
	Save(source CatalogSource) (CatalogSource, error)

	// Delete removes a catalog source by its source ID.
	Delete(sourceID string) error

	// GetAll retrieves all catalog sources.
	GetAll() ([]CatalogSource, error)

	// GetAllStatuses returns a map of source ID to status/error for all sources.
	GetAllStatuses() (map[string]SourceStatus, error)
}

CatalogSourceRepository defines the interface for catalog source persistence.

type PropertyOption

type PropertyOption struct {
	TypeID           int32    `json:"type_id"`
	Name             string   `json:"name"`
	IsCustomProperty bool     `json:"is_custom_property"`
	StringValue      []string `json:"string_value"`
	ArrayValue       []string `json:"array_value"`
	MinDoubleValue   *float64 `json:"min_double_value"`
	MaxDoubleValue   *float64 `json:"max_double_value"`
	MinIntValue      *int64   `json:"min_int_value"`
	MaxIntValue      *int64   `json:"max_int_value"`
}

func (*PropertyOption) FullName

func (po *PropertyOption) FullName(prefix string) string

FullName returns the complete name of the property to pass to filterQuery. Prefix is optional.

func (*PropertyOption) ValueField

func (po *PropertyOption) ValueField() string

ValueField returns string_value, array_value, double_value or int_value depending on which fields are non-nil.

type PropertyOptionType

type PropertyOptionType int
const (
	ContextPropertyOptionType PropertyOptionType = iota
	ArtifactPropertyOptionType
)

type PropertyOptionsRefresher

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

PropertyOptionsRefresher refreshes the materialized views after a short delay to prevent unnecessary duplicate refreshes.

func (*PropertyOptionsRefresher) Trigger

func (r *PropertyOptionsRefresher) Trigger()

type PropertyOptionsRepository

type PropertyOptionsRepository interface {
	// Refresh rebuilds the materialized view.
	Refresh(t PropertyOptionType) error
	// List returns all the options for a type. If typeID is 0, all types are returned.
	List(t PropertyOptionType, typeID int32) ([]PropertyOption, error)
}

type SourceStatus

type SourceStatus struct {
	Status string
	Error  string
}

SourceStatus holds the operational status and error for a source.

Jump to

Keyboard shortcuts

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