Documentation ¶
Index ¶
- Constants
- type BaseRepository
- type BaseRepositoryProvider
- type ExperimentRepository
- func (r ExperimentRepository) Create(ctx context.Context, experiment *models.Experiment) error
- func (r ExperimentRepository) Delete(ctx context.Context, experiment *models.Experiment) error
- func (r ExperimentRepository) DeleteBatch(ctx context.Context, ids []*int32) error
- func (r ExperimentRepository) GetByID(ctx context.Context, experimentID int32) (*models.Experiment, error)
- func (r ExperimentRepository) GetByName(ctx context.Context, name string) (*models.Experiment, error)
- func (r ExperimentRepository) Update(ctx context.Context, experiment *models.Experiment) error
- type ExperimentRepositoryProvider
- type MetricRepository
- func (r MetricRepository) CreateBatch(ctx context.Context, run *models.Run, batchSize int, metrics []models.Metric) error
- func (r MetricRepository) GetMetricHistories(ctx context.Context, experimentIDs []string, runIDs []string, ...) (*sql.Rows, func(*sql.Rows, interface{}) error, error)
- func (r MetricRepository) GetMetricHistoryBulk(ctx context.Context, runIDs []string, key string, limit int) ([]models.Metric, error)
- func (r MetricRepository) GetMetricHistoryByRunIDAndKey(ctx context.Context, runID, key string) ([]models.Metric, error)
- type MetricRepositoryProvider
- type ParamRepository
- type ParamRepositoryProvider
- type RunRepository
- func (r RunRepository) Archive(ctx context.Context, run *models.Run) error
- func (r RunRepository) ArchiveBatch(ctx context.Context, ids []string) error
- func (r RunRepository) Create(ctx context.Context, run *models.Run) error
- func (r RunRepository) Delete(ctx context.Context, run *models.Run) error
- func (r RunRepository) DeleteBatch(ctx context.Context, ids []string) error
- func (r RunRepository) GetByID(ctx context.Context, id string) (*models.Run, error)
- func (r RunRepository) GetByIDAndLifecycleStage(ctx context.Context, id string, lifecycleStage models.LifecycleStage) (*models.Run, error)
- func (r RunRepository) Restore(ctx context.Context, run *models.Run) error
- func (r RunRepository) RestoreBatch(ctx context.Context, ids []string) error
- func (r RunRepository) SetRunTagsBatch(ctx context.Context, run *models.Run, batchSize int, tags []models.Tag) error
- func (r RunRepository) Update(ctx context.Context, run *models.Run) error
- func (r RunRepository) UpdateWithTransaction(ctx context.Context, tx *gorm.DB, run *models.Run) error
- type RunRepositoryProvider
- type TagRepository
- func (r TagRepository) CreateExperimentTag(ctx context.Context, experimentTag *models.ExperimentTag) error
- func (r TagRepository) CreateRunTagWithTransaction(ctx context.Context, tx *gorm.DB, runID, key, value string) error
- func (r TagRepository) Delete(ctx context.Context, tag *models.Tag) error
- func (r TagRepository) GetByRunIDAndKey(ctx context.Context, runID, key string) (*models.Tag, error)
- type TagRepositoryProvider
Constants ¶
const ( MetricHistoriesDefaultLimit = 10000000 MetricHistoryBulkDefaultLimit = 25000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepository ¶
type BaseRepository struct {
// contains filtered or unexported fields
}
BaseRepository represents base repository object.
func (BaseRepository) GetDB ¶
func (r BaseRepository) GetDB() *gorm.DB
GetDB returns current DB instance.
type BaseRepositoryProvider ¶
BaseRepositoryProvider provides base repository interface.
type ExperimentRepository ¶
type ExperimentRepository struct {
// contains filtered or unexported fields
}
ExperimentRepository repository to work with `experiment` entity.
func NewExperimentRepository ¶
func NewExperimentRepository(db *gorm.DB) *ExperimentRepository
NewExperimentRepository creates repository to work with `experiment` entity.
func (ExperimentRepository) Create ¶
func (r ExperimentRepository) Create(ctx context.Context, experiment *models.Experiment) error
Create creates new models.Experiment entity.
func (ExperimentRepository) Delete ¶ added in v0.3.0
func (r ExperimentRepository) Delete(ctx context.Context, experiment *models.Experiment) error
Delete removes the existing models.Experiment from the db.
func (ExperimentRepository) DeleteBatch ¶ added in v0.3.0
func (r ExperimentRepository) DeleteBatch(ctx context.Context, ids []*int32) error
DeleteBatch removes existing []models.Experiment in batch from the db.
func (ExperimentRepository) GetByID ¶
func (r ExperimentRepository) GetByID(ctx context.Context, experimentID int32) (*models.Experiment, error)
GetByID returns experiment by its ID.
func (ExperimentRepository) GetByName ¶
func (r ExperimentRepository) GetByName(ctx context.Context, name string) (*models.Experiment, error)
GetByName returns experiment by its name.
func (ExperimentRepository) Update ¶
func (r ExperimentRepository) Update(ctx context.Context, experiment *models.Experiment) error
Update updates existing models.Experiment entity.
type ExperimentRepositoryProvider ¶
type ExperimentRepositoryProvider interface { // Create creates new models.Experiment entity. Create(ctx context.Context, experiment *models.Experiment) error // GetByID returns experiment by its ID. GetByID(ctx context.Context, experimentID int32) (*models.Experiment, error) // GetByName returns experiment by its name. GetByName(ctx context.Context, name string) (*models.Experiment, error) // Update updates existing models.Experiment entity. Update(ctx context.Context, experiment *models.Experiment) error // Delete removes the existing models.Experiment from the db. Delete(ctx context.Context, experiment *models.Experiment) error // DeleteBatch removes existing []models.Experiment in batch from the db. DeleteBatch(ctx context.Context, ids []*int32) error }
ExperimentRepositoryProvider provides an interface to work with `experiment` entity.
type MetricRepository ¶
type MetricRepository struct {
BaseRepository
}
MetricRepository repository to work with models.Metric entity.
func NewMetricRepository ¶
func NewMetricRepository(db *gorm.DB) *MetricRepository
NewMetricRepository creates repository to work with models.Metric entity.
func (MetricRepository) CreateBatch ¶
func (r MetricRepository) CreateBatch( ctx context.Context, run *models.Run, batchSize int, metrics []models.Metric, ) error
CreateBatch creates []models.Metric entities in batch.
func (MetricRepository) GetMetricHistories ¶
func (r MetricRepository) GetMetricHistories( ctx context.Context, experimentIDs []string, runIDs []string, metricKeys []string, viewType request.ViewType, limit int32, ) (*sql.Rows, func(*sql.Rows, interface{}) error, error)
GetMetricHistories returns metric histories by request parameters. TODO think about to use interface instead of underlying type for -> func(*sql.Rows, interface{})
func (MetricRepository) GetMetricHistoryBulk ¶
func (r MetricRepository) GetMetricHistoryBulk( ctx context.Context, runIDs []string, key string, limit int, ) ([]models.Metric, error)
GetMetricHistoryBulk returns metrics history bulk.
func (MetricRepository) GetMetricHistoryByRunIDAndKey ¶
func (r MetricRepository) GetMetricHistoryByRunIDAndKey( ctx context.Context, runID, key string, ) ([]models.Metric, error)
GetMetricHistoryByRunIDAndKey returns metrics history by RunID and Key.
type MetricRepositoryProvider ¶
type MetricRepositoryProvider interface { BaseRepositoryProvider // CreateBatch creates []models.Metric entities in batch. CreateBatch(ctx context.Context, run *models.Run, batchSize int, params []models.Metric) error // GetMetricHistories returns metric histories by request parameters. GetMetricHistories( ctx context.Context, experimentIDs []string, runIDs []string, metricKeys []string, viewType request.ViewType, limit int32, ) (*sql.Rows, func(*sql.Rows, interface{}) error, error) // GetMetricHistoryBulk returns metrics history bulk. GetMetricHistoryBulk(ctx context.Context, runIDs []string, key string, limit int) ([]models.Metric, error) // GetMetricHistoryByRunIDAndKey returns metrics history by RunID and Key. GetMetricHistoryByRunIDAndKey(ctx context.Context, runID, key string) ([]models.Metric, error) }
MetricRepositoryProvider provides an interface to work with models.Metric entity.
type ParamRepository ¶
type ParamRepository struct {
BaseRepository
}
ParamRepository repository to work with models.Param entity.
func NewParamRepository ¶
func NewParamRepository(db *gorm.DB) *ParamRepository
NewParamRepository creates repository to work with models.Param entity.
func (ParamRepository) CreateBatch ¶
func (r ParamRepository) CreateBatch(ctx context.Context, batchSize int, params []models.Param) error
CreateBatch creates []models.Param entities in batch.
type ParamRepositoryProvider ¶
type ParamRepositoryProvider interface { // CreateBatch creates []models.Param entities in batch. CreateBatch(ctx context.Context, batchSize int, params []models.Param) error }
ParamRepositoryProvider provides an interface to work with models.Param entity.
type RunRepository ¶
type RunRepository struct {
BaseRepository
}
RunRepository repository to work with models.Run entity.
func NewRunRepository ¶
func NewRunRepository(db *gorm.DB) *RunRepository
NewRunRepository creates repository to work with models.Run entity.
func (RunRepository) ArchiveBatch ¶
func (r RunRepository) ArchiveBatch(ctx context.Context, ids []string) error
ArchiveBatch marks existing models.Run entities as archived.
func (RunRepository) DeleteBatch ¶
func (r RunRepository) DeleteBatch(ctx context.Context, ids []string) error
DeleteBatch removes existing models.Run from the db.
func (RunRepository) GetByIDAndLifecycleStage ¶
func (r RunRepository) GetByIDAndLifecycleStage( ctx context.Context, id string, lifecycleStage models.LifecycleStage, ) (*models.Run, error)
GetByIDAndLifecycleStage returns models.Run entity by its ID and Lifecycle Stage
func (RunRepository) RestoreBatch ¶
func (r RunRepository) RestoreBatch(ctx context.Context, ids []string) error
RestoreBatch marks existing models.Run entities as active.
func (RunRepository) SetRunTagsBatch ¶
func (r RunRepository) SetRunTagsBatch(ctx context.Context, run *models.Run, batchSize int, tags []models.Tag) error
SetRunTagsBatch sets Run tags in batch.
func (RunRepository) UpdateWithTransaction ¶
func (r RunRepository) UpdateWithTransaction(ctx context.Context, tx *gorm.DB, run *models.Run) error
UpdateWithTransaction updates existing models.Run entity in scope of transaction.
type RunRepositoryProvider ¶
type RunRepositoryProvider interface { BaseRepositoryProvider // GetByID returns models.Run entity by its ID. GetByID(ctx context.Context, id string) (*models.Run, error) // GetByIDAndLifecycleStage returns models.Run entity by its ID and Lifecycle Stage GetByIDAndLifecycleStage( ctx context.Context, id string, lifecycleStage models.LifecycleStage, ) (*models.Run, error) // Create creates new models.Run entity. Create(ctx context.Context, run *models.Run) error // Update updates existing models.Experiment entity. Update(ctx context.Context, run *models.Run) error // Archive marks existing models.Run entity as archived. Archive(ctx context.Context, run *models.Run) error // Delete removes the existing models.Run Delete(ctx context.Context, run *models.Run) error // Restore marks existing models.Run entity as active. Restore(ctx context.Context, run *models.Run) error // ArchiveBatch marks existing models.Run entities as archived. ArchiveBatch(ctx context.Context, ids []string) error // DeleteBatch removes the existing models.Run from the db. DeleteBatch(ctx context.Context, ids []string) error // RestoreBatch marks existing models.Run entities as active. RestoreBatch(ctx context.Context, ids []string) error // SetRunTagsBatch sets Run tags in batch. SetRunTagsBatch(ctx context.Context, run *models.Run, batchSize int, tags []models.Tag) error // UpdateWithTransaction updates existing models.Run entity in scope of transaction. UpdateWithTransaction(ctx context.Context, tx *gorm.DB, run *models.Run) error }
RunRepositoryProvider provides an interface to work with models.Run entity.
type TagRepository ¶
type TagRepository struct {
BaseRepository
}
TagRepository repository to work with models.Tag entity.
func NewTagRepository ¶
func NewTagRepository(db *gorm.DB) *TagRepository
NewTagRepository creates repository to work with models.Tag entity.
func (TagRepository) CreateExperimentTag ¶
func (r TagRepository) CreateExperimentTag(ctx context.Context, experimentTag *models.ExperimentTag) error
CreateExperimentTag creates new models.ExperimentTag entity connected to models.Experiment.
func (TagRepository) CreateRunTagWithTransaction ¶
func (r TagRepository) CreateRunTagWithTransaction( ctx context.Context, tx *gorm.DB, runID, key, value string, ) error
CreateRunTagWithTransaction creates new models.Tag entity connected to models.Run.
func (TagRepository) GetByRunIDAndKey ¶
func (r TagRepository) GetByRunIDAndKey(ctx context.Context, runID, key string) (*models.Tag, error)
GetByRunIDAndKey returns models.Tag by provided RunID and Tag Key.
type TagRepositoryProvider ¶
type TagRepositoryProvider interface { BaseRepositoryProvider // CreateExperimentTag creates new models.ExperimentTag entity connected to models.Experiment. CreateExperimentTag(ctx context.Context, experimentTag *models.ExperimentTag) error // CreateRunTagWithTransaction creates new models.Tag entity connected to models.Run. CreateRunTagWithTransaction(ctx context.Context, tx *gorm.DB, runID, key, value string) error // GetByRunIDAndKey returns models.Tag by provided RunID and Tag Key. GetByRunIDAndKey(ctx context.Context, runID, key string) (*models.Tag, error) // Delete deletes existing models.Tag entity. Delete(ctx context.Context, tag *models.Tag) error }
TagRepositoryProvider provides an interface to work with models.Tag entity.