Documentation
¶
Index ¶
- Variables
- func DatastoreSpec() *datastore.Spec
- func MapArtifactPropertyToProperties(artProperty schema.ArtifactProperty) models.Properties
- func MapContextPropertyToProperties(contextProperty schema.ContextProperty) models.Properties
- func MapExecutionPropertyToProperties(executionProperty schema.ExecutionProperty) models.Properties
- func MapPropertiesToArtifactProperty(prop models.Properties, artifactID int32, isCustomProperty bool) schema.ArtifactProperty
- func MapPropertiesToContextProperty(prop models.Properties, contextID int32, isCustomProperty bool) schema.ContextProperty
- func MapPropertiesToExecutionProperty(prop models.Properties, executionID int32, isCustomProperty bool) schema.ExecutionProperty
- func NewArtifactRepository(db *gorm.DB, artifactTypes datastore.ArtifactTypeMap) models.ArtifactRepository
- func NewDataSetRepository(db *gorm.DB, typeID int32) models.DataSetRepository
- func NewDocArtifactRepository(db *gorm.DB, typeID int32) models.DocArtifactRepository
- func NewExperimentRepository(db *gorm.DB, typeID int32) models.ExperimentRepository
- func NewExperimentRunRepository(db *gorm.DB, typeID int32) models.ExperimentRunRepository
- func NewInferenceServiceRepository(db *gorm.DB, typeID int32) models.InferenceServiceRepository
- func NewMetricHistoryRepository(db *gorm.DB, typeID int32) models.MetricHistoryRepository
- func NewMetricRepository(db *gorm.DB, typeID int32) models.MetricRepository
- func NewModelArtifactRepository(db *gorm.DB, typeID int32) models.ModelArtifactRepository
- func NewModelVersionRepository(db *gorm.DB, typeID int32) models.ModelVersionRepository
- func NewParameterRepository(db *gorm.DB, typeID int32) models.ParameterRepository
- func NewRegisteredModelRepository(db *gorm.DB, typeID int32) models.RegisteredModelRepository
- func NewServeModelRepository(db *gorm.DB, typeID int32) models.ServeModelRepository
- func NewServingEnvironmentRepository(db *gorm.DB, typeID int32) models.ServingEnvironmentRepository
- func NewTypePropertyRepository(db *gorm.DB) models.TypePropertyRepository
- func NewTypeRepository(db *gorm.DB) models.TypeRepository
- type ArtifactRepositoryImpl
- type BaseListOptions
- type DataSetRepositoryImpl
- type DocArtifactRepositoryImpl
- type EntityToPropertiesMapper
- type EntityToSchemaMapper
- type ExperimentRepositoryImpl
- type ExperimentRunRepositoryImpl
- type FilterApplier
- type GenericRepository
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) ApplyStandardPagination(query *gorm.DB, listOptions TListOpts, entities any) *gorm.DB
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) CreateDefaultPaginationToken(entity TSchema, listOptions TListOpts) string
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByID(id int32) (TEntity, error)
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByName(name string) (TEntity, error)
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetConfig() GenericRepositoryConfig[TEntity, TSchema, TProp, TListOpts]
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) List(listOptions TListOpts) (*models.ListWrapper[TEntity], error)
- func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) Save(entity TEntity, parentResourceID *int32) (TEntity, error)
- type GenericRepositoryConfig
- type InferenceServiceRepositoryImpl
- type MetricHistoryRepositoryImpl
- type MetricRepositoryImpl
- type ModelArtifactRepositoryImpl
- type ModelVersionRepositoryImpl
- type ParameterRepositoryImpl
- type PropertyEntity
- type RegisteredModelRepositoryImpl
- type SchemaEntity
- type SchemaToEntityMapper
- type ServeModelRepositoryImpl
- type ServingEnvironmentRepositoryImpl
- type TypeRepositoryImpl
Constants ¶
This section is empty.
Variables ¶
var ErrArtifactNotFound = errors.New("artifact by id not found")
var ErrDataSetNotFound = errors.New("dataset by id not found")
var ErrDocArtifactNotFound = errors.New("doc artifact by id not found")
var ErrExperimentNotFound = errors.New("experiment by id not found")
var ErrExperimentRunNotFound = errors.New("experiment run by id not found")
var ErrInferenceServiceNotFound = errors.New("inference service by id not found")
var ErrMetricHistoryNotFound = errors.New("metric history by id not found")
var ErrMetricNotFound = errors.New("metric by id not found")
var ErrModelArtifactNotFound = errors.New("model artifact by id not found")
var ErrModelVersionNotFound = errors.New("model version by id not found")
var ErrParameterNotFound = errors.New("parameter by id not found")
var ErrRegisteredModelNotFound = errors.New("registered model by id not found")
var ErrServeModelNotFound = errors.New("serve model by id not found")
var ErrServingEnvironmentNotFound = errors.New("serving environment by id not found")
Functions ¶
func DatastoreSpec ¶ added in v0.3.2
func MapArtifactPropertyToProperties ¶ added in v0.3.0
func MapArtifactPropertyToProperties(artProperty schema.ArtifactProperty) models.Properties
MapArtifactPropertyToProperties converts schema.ArtifactProperty to models.Properties
func MapContextPropertyToProperties ¶ added in v0.3.0
func MapContextPropertyToProperties(contextProperty schema.ContextProperty) models.Properties
MapContextPropertyToProperties converts schema.ContextProperty to models.Properties
func MapExecutionPropertyToProperties ¶ added in v0.3.0
func MapExecutionPropertyToProperties(executionProperty schema.ExecutionProperty) models.Properties
MapExecutionPropertyToProperties converts schema.ExecutionProperty to models.Properties
func MapPropertiesToArtifactProperty ¶ added in v0.3.0
func MapPropertiesToArtifactProperty(prop models.Properties, artifactID int32, isCustomProperty bool) schema.ArtifactProperty
MapPropertiesToArtifactProperty converts models.Properties to schema.ArtifactProperty
func MapPropertiesToContextProperty ¶ added in v0.3.0
func MapPropertiesToContextProperty(prop models.Properties, contextID int32, isCustomProperty bool) schema.ContextProperty
MapPropertiesToContextProperty converts models.Properties to schema.ContextProperty
func MapPropertiesToExecutionProperty ¶ added in v0.3.0
func MapPropertiesToExecutionProperty(prop models.Properties, executionID int32, isCustomProperty bool) schema.ExecutionProperty
MapPropertiesToExecutionProperty converts models.Properties to schema.ExecutionProperty
func NewArtifactRepository ¶
func NewArtifactRepository(db *gorm.DB, artifactTypes datastore.ArtifactTypeMap) models.ArtifactRepository
func NewDataSetRepository ¶ added in v0.3.0
func NewDataSetRepository(db *gorm.DB, typeID int32) models.DataSetRepository
func NewDocArtifactRepository ¶
func NewDocArtifactRepository(db *gorm.DB, typeID int32) models.DocArtifactRepository
func NewExperimentRepository ¶ added in v0.3.0
func NewExperimentRepository(db *gorm.DB, typeID int32) models.ExperimentRepository
func NewExperimentRunRepository ¶ added in v0.3.0
func NewExperimentRunRepository(db *gorm.DB, typeID int32) models.ExperimentRunRepository
func NewInferenceServiceRepository ¶
func NewInferenceServiceRepository(db *gorm.DB, typeID int32) models.InferenceServiceRepository
func NewMetricHistoryRepository ¶ added in v0.3.0
func NewMetricHistoryRepository(db *gorm.DB, typeID int32) models.MetricHistoryRepository
func NewMetricRepository ¶ added in v0.3.0
func NewMetricRepository(db *gorm.DB, typeID int32) models.MetricRepository
func NewModelArtifactRepository ¶
func NewModelArtifactRepository(db *gorm.DB, typeID int32) models.ModelArtifactRepository
func NewModelVersionRepository ¶
func NewModelVersionRepository(db *gorm.DB, typeID int32) models.ModelVersionRepository
func NewParameterRepository ¶ added in v0.3.0
func NewParameterRepository(db *gorm.DB, typeID int32) models.ParameterRepository
func NewRegisteredModelRepository ¶
func NewRegisteredModelRepository(db *gorm.DB, typeID int32) models.RegisteredModelRepository
func NewServeModelRepository ¶
func NewServeModelRepository(db *gorm.DB, typeID int32) models.ServeModelRepository
func NewServingEnvironmentRepository ¶
func NewServingEnvironmentRepository(db *gorm.DB, typeID int32) models.ServingEnvironmentRepository
func NewTypePropertyRepository ¶ added in v0.3.2
func NewTypePropertyRepository(db *gorm.DB) models.TypePropertyRepository
func NewTypeRepository ¶
func NewTypeRepository(db *gorm.DB) models.TypeRepository
Types ¶
type ArtifactRepositoryImpl ¶
type ArtifactRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*ArtifactRepositoryImpl) GetByID ¶
func (r *ArtifactRepositoryImpl) GetByID(id int32) (models.Artifact, error)
func (*ArtifactRepositoryImpl) List ¶
func (r *ArtifactRepositoryImpl) List(listOptions models.ArtifactListOptions) (*models.ListWrapper[models.Artifact], error)
type BaseListOptions ¶ added in v0.3.0
type BaseListOptions interface {
GetPageSize() int32
GetNextPageToken() string
SetNextPageToken(*string)
GetOrderBy() string
GetSortOrder() string
GetFilterQuery() string
}
List options interface
type DataSetRepositoryImpl ¶ added in v0.3.0
type DataSetRepositoryImpl struct {
*GenericRepository[models.DataSet, schema.Artifact, schema.ArtifactProperty, *models.DataSetListOptions]
}
func (*DataSetRepositoryImpl) List ¶ added in v0.3.0
func (r *DataSetRepositoryImpl) List(listOptions models.DataSetListOptions) (*models.ListWrapper[models.DataSet], error)
List adapts the generic repository List method to match the interface contract
type DocArtifactRepositoryImpl ¶
type DocArtifactRepositoryImpl struct {
*GenericRepository[models.DocArtifact, schema.Artifact, schema.ArtifactProperty, *models.DocArtifactListOptions]
}
func (*DocArtifactRepositoryImpl) List ¶
func (r *DocArtifactRepositoryImpl) List(listOptions models.DocArtifactListOptions) (*models.ListWrapper[models.DocArtifact], error)
type EntityToPropertiesMapper ¶ added in v0.3.0
type EntityToPropertiesMapper[TEntity any, TProp PropertyEntity] func(TEntity, int32) []TProp
type EntityToSchemaMapper ¶ added in v0.3.0
type EntityToSchemaMapper[TEntity any, TSchema SchemaEntity] func(TEntity) TSchema
Mapper function types
type ExperimentRepositoryImpl ¶ added in v0.3.0
type ExperimentRepositoryImpl struct {
*GenericRepository[models.Experiment, schema.Context, schema.ContextProperty, *models.ExperimentListOptions]
}
func (*ExperimentRepositoryImpl) List ¶ added in v0.3.0
func (r *ExperimentRepositoryImpl) List(listOptions models.ExperimentListOptions) (*models.ListWrapper[models.Experiment], error)
func (*ExperimentRepositoryImpl) Save ¶ added in v0.3.0
func (r *ExperimentRepositoryImpl) Save(experiment models.Experiment) (models.Experiment, error)
type ExperimentRunRepositoryImpl ¶ added in v0.3.0
type ExperimentRunRepositoryImpl struct {
*GenericRepository[models.ExperimentRun, schema.Context, schema.ContextProperty, *models.ExperimentRunListOptions]
}
func (*ExperimentRunRepositoryImpl) List ¶ added in v0.3.0
func (r *ExperimentRunRepositoryImpl) List(listOptions models.ExperimentRunListOptions) (*models.ListWrapper[models.ExperimentRun], error)
func (*ExperimentRunRepositoryImpl) Save ¶ added in v0.3.0
func (r *ExperimentRunRepositoryImpl) Save(experimentRun models.ExperimentRun, experimentID *int32) (models.ExperimentRun, error)
type FilterApplier ¶ added in v0.3.0
type FilterApplier interface {
GetRestEntityType() filter.RestEntityType
}
Filter applier interface for entities that support advanced filtering
type GenericRepository ¶ added in v0.3.0
type GenericRepository[TEntity any, TSchema SchemaEntity, TProp PropertyEntity, TListOpts BaseListOptions] struct { // contains filtered or unexported fields }
Generic repository implementation
func NewGenericRepository ¶ added in v0.3.0
func NewGenericRepository[TEntity any, TSchema SchemaEntity, TProp PropertyEntity, TListOpts BaseListOptions]( config GenericRepositoryConfig[TEntity, TSchema, TProp, TListOpts], ) *GenericRepository[TEntity, TSchema, TProp, TListOpts]
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) ApplyStandardPagination ¶ added in v0.3.3
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) ApplyStandardPagination(query *gorm.DB, listOptions TListOpts, entities any) *gorm.DB
ApplyStandardPagination applies the standard pagination logic using scopes.PaginateWithTablePrefix
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) CreateDefaultPaginationToken ¶ added in v0.3.3
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) CreateDefaultPaginationToken(entity TSchema, listOptions TListOpts) string
CreateDefaultPaginationToken provides a standard implementation that works for all entities with ID, CreateTimeSinceEpoch, and LastUpdateTimeSinceEpoch fields
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByID ¶ added in v0.3.0
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByID(id int32) (TEntity, error)
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByName ¶ added in v0.3.2
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetByName(name string) (TEntity, error)
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetConfig ¶ added in v0.3.2
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) GetConfig() GenericRepositoryConfig[TEntity, TSchema, TProp, TListOpts]
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) List ¶ added in v0.3.0
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) List(listOptions TListOpts) (*models.ListWrapper[TEntity], error)
func (*GenericRepository[TEntity, TSchema, TProp, TListOpts]) Save ¶ added in v0.3.0
func (r *GenericRepository[TEntity, TSchema, TProp, TListOpts]) Save(entity TEntity, parentResourceID *int32) (TEntity, error)
type GenericRepositoryConfig ¶ added in v0.3.0
type GenericRepositoryConfig[TEntity any, TSchema SchemaEntity, TProp PropertyEntity, TListOpts BaseListOptions] struct { DB *gorm.DB TypeID int32 EntityToSchema EntityToSchemaMapper[TEntity, TSchema] SchemaToEntity SchemaToEntityMapper[TSchema, TProp, TEntity] EntityToProperties EntityToPropertiesMapper[TEntity, TProp] NotFoundError error EntityName string PropertyFieldName string // "artifact_id", "context_id", or "execution_id" ApplyListFilters func(*gorm.DB, TListOpts) *gorm.DB CreatePaginationToken func(TSchema, TListOpts) string // Optional - defaults to standard implementation ApplyCustomOrdering func(*gorm.DB, TListOpts) *gorm.DB // Optional - custom ordering logic that bypasses standard pagination IsNewEntity func(TEntity) bool HasCustomProperties func(TEntity) bool EntityMappingFuncs filter.EntityMappingFunctions // Optional - custom entity mappings for filtering }
Generic repository configuration
type InferenceServiceRepositoryImpl ¶
type InferenceServiceRepositoryImpl struct {
*GenericRepository[models.InferenceService, schema.Context, schema.ContextProperty, *models.InferenceServiceListOptions]
}
func (*InferenceServiceRepositoryImpl) List ¶
func (r *InferenceServiceRepositoryImpl) List(listOptions models.InferenceServiceListOptions) (*models.ListWrapper[models.InferenceService], error)
func (*InferenceServiceRepositoryImpl) Save ¶
func (r *InferenceServiceRepositoryImpl) Save(inferenceService models.InferenceService) (models.InferenceService, error)
type MetricHistoryRepositoryImpl ¶ added in v0.3.0
type MetricHistoryRepositoryImpl struct {
*GenericRepository[models.MetricHistory, schema.Artifact, schema.ArtifactProperty, *models.MetricHistoryListOptions]
}
func (*MetricHistoryRepositoryImpl) List ¶ added in v0.3.0
func (r *MetricHistoryRepositoryImpl) List(listOptions models.MetricHistoryListOptions) (*models.ListWrapper[models.MetricHistory], error)
type MetricRepositoryImpl ¶ added in v0.3.0
type MetricRepositoryImpl struct {
*GenericRepository[models.Metric, schema.Artifact, schema.ArtifactProperty, *models.MetricListOptions]
}
func (*MetricRepositoryImpl) List ¶ added in v0.3.0
func (r *MetricRepositoryImpl) List(listOptions models.MetricListOptions) (*models.ListWrapper[models.Metric], error)
List adapts the generic repository List method to match the interface contract
type ModelArtifactRepositoryImpl ¶
type ModelArtifactRepositoryImpl struct {
*GenericRepository[models.ModelArtifact, schema.Artifact, schema.ArtifactProperty, *models.ModelArtifactListOptions]
}
func (*ModelArtifactRepositoryImpl) List ¶
func (r *ModelArtifactRepositoryImpl) List(listOptions models.ModelArtifactListOptions) (*models.ListWrapper[models.ModelArtifact], error)
List adapts the generic repository List method to match the interface contract
type ModelVersionRepositoryImpl ¶
type ModelVersionRepositoryImpl struct {
*GenericRepository[models.ModelVersion, schema.Context, schema.ContextProperty, *models.ModelVersionListOptions]
}
func (*ModelVersionRepositoryImpl) List ¶
func (r *ModelVersionRepositoryImpl) List(listOptions models.ModelVersionListOptions) (*models.ListWrapper[models.ModelVersion], error)
func (*ModelVersionRepositoryImpl) Save ¶
func (r *ModelVersionRepositoryImpl) Save(modelVersion models.ModelVersion) (models.ModelVersion, error)
type ParameterRepositoryImpl ¶ added in v0.3.0
type ParameterRepositoryImpl struct {
*GenericRepository[models.Parameter, schema.Artifact, schema.ArtifactProperty, *models.ParameterListOptions]
}
func (*ParameterRepositoryImpl) List ¶ added in v0.3.0
func (r *ParameterRepositoryImpl) List(listOptions models.ParameterListOptions) (*models.ListWrapper[models.Parameter], error)
List adapts the generic repository List method to match the interface contract
type PropertyEntity ¶ added in v0.3.0
type PropertyEntity interface {
schema.ArtifactProperty | schema.ContextProperty | schema.ExecutionProperty
}
type RegisteredModelRepositoryImpl ¶
type RegisteredModelRepositoryImpl struct {
*GenericRepository[models.RegisteredModel, schema.Context, schema.ContextProperty, *models.RegisteredModelListOptions]
}
func (*RegisteredModelRepositoryImpl) List ¶
func (r *RegisteredModelRepositoryImpl) List(listOptions models.RegisteredModelListOptions) (*models.ListWrapper[models.RegisteredModel], error)
func (*RegisteredModelRepositoryImpl) Save ¶
func (r *RegisteredModelRepositoryImpl) Save(model models.RegisteredModel) (models.RegisteredModel, error)
type SchemaEntity ¶ added in v0.3.0
Generic constraints for different entity types
type SchemaToEntityMapper ¶ added in v0.3.0
type SchemaToEntityMapper[TSchema SchemaEntity, TProp PropertyEntity, TEntity any] func(TSchema, []TProp) TEntity
type ServeModelRepositoryImpl ¶
type ServeModelRepositoryImpl struct {
*GenericRepository[models.ServeModel, schema.Execution, schema.ExecutionProperty, *models.ServeModelListOptions]
}
func (*ServeModelRepositoryImpl) List ¶
func (r *ServeModelRepositoryImpl) List(listOptions models.ServeModelListOptions) (*models.ListWrapper[models.ServeModel], error)
func (*ServeModelRepositoryImpl) Save ¶
func (r *ServeModelRepositoryImpl) Save(serveModel models.ServeModel, inferenceServiceID *int32) (models.ServeModel, error)
type ServingEnvironmentRepositoryImpl ¶
type ServingEnvironmentRepositoryImpl struct {
*GenericRepository[models.ServingEnvironment, schema.Context, schema.ContextProperty, *models.ServingEnvironmentListOptions]
}
func (*ServingEnvironmentRepositoryImpl) List ¶
func (r *ServingEnvironmentRepositoryImpl) List(listOptions models.ServingEnvironmentListOptions) (*models.ListWrapper[models.ServingEnvironment], error)
func (*ServingEnvironmentRepositoryImpl) Save ¶
func (r *ServingEnvironmentRepositoryImpl) Save(servEnv models.ServingEnvironment) (models.ServingEnvironment, error)
type TypeRepositoryImpl ¶
type TypeRepositoryImpl struct {
// contains filtered or unexported fields
}