Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRunMetricsRequestToMap(req *request.GetRunMetricsRequest) (models.MetricKeysMap, error)
- func NormaliseGetRunInfoRequest(req *request.GetRunInfoRequest) *request.GetRunInfoRequest
- func ValidateGetRunInfoRequest(req *request.GetRunInfoRequest) error
- type Service
- func (s Service) DeleteRun(ctx context.Context, namespaceID uint, req *request.DeleteRunRequest) error
- func (s Service) GetRunInfo(ctx context.Context, namespaceID uint, req *request.GetRunInfoRequest) (*models.Run, error)
- func (s Service) GetRunMetrics(ctx context.Context, namespaceID uint, runID string, ...) ([]models.Metric, models.MetricKeysMap, error)
- func (s Service) GetRunsActive(ctx context.Context, namespaceID uint, req *request.GetRunsActiveRequest) ([]models.Run, error)
- func (s Service) ProcessBatch(ctx context.Context, namespaceID uint, action string, ids []string) error
- func (s Service) SearchAlignedMetrics(ctx context.Context, namespaceID uint, ...) (*sql.Rows, func(*sql.Rows) (*models.AlignedMetric, error), int, error)
- func (s Service) SearchMetrics(ctx context.Context, namespaceID uint, timeZoneOffset int, ...) (*sql.Rows, int64, repositories.SearchResultMap, error)
- func (s Service) SearchRuns(ctx context.Context, namespaceID uint, tzOffset int, ...) ([]models.Run, int64, error)
- func (s Service) UpdateRun(ctx context.Context, namespaceID uint, req *request.UpdateRunRequest) error
Constants ¶
const ( BatchActionDelete = "delete" BatchActionArchive = "archive" BatchActionRestore = "restore" )
allowed batch actions.
Variables ¶
var SupportedSequences = []string{
"audios",
"distributions",
"figures",
"images",
"log_records",
"logs",
"texts",
"metric",
}
SupportedSequences list of supported Sequences for `GET /runs/:id/info` request.
Functions ¶
func ConvertRunMetricsRequestToMap ¶
func ConvertRunMetricsRequestToMap(req *request.GetRunMetricsRequest) (models.MetricKeysMap, error)
ConvertRunMetricsRequestToMap converts request of `GET /runs/:id/metric/get-batch` endpoint to internal DTO object.
func NormaliseGetRunInfoRequest ¶
func NormaliseGetRunInfoRequest(req *request.GetRunInfoRequest) *request.GetRunInfoRequest
NormaliseGetRunInfoRequest normalizes request object for `GET /runs/:id/info` endpoint.
func ValidateGetRunInfoRequest ¶
func ValidateGetRunInfoRequest(req *request.GetRunInfoRequest) error
ValidateGetRunInfoRequest validates `GET /runs/:id/info` request.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides service layer to work with `run` business logic.
func NewService ¶
func NewService( runRepository repositories.RunRepositoryProvider, metricRepository repositories.MetricRepositoryProvider, ) *Service
NewService creates new Service instance.
func (Service) DeleteRun ¶
func (s Service) DeleteRun( ctx context.Context, namespaceID uint, req *request.DeleteRunRequest, ) error
DeleteRun deletes requested run.
func (Service) GetRunInfo ¶
func (s Service) GetRunInfo( ctx context.Context, namespaceID uint, req *request.GetRunInfoRequest, ) (*models.Run, error)
GetRunInfo returns run info.
func (Service) GetRunMetrics ¶
func (s Service) GetRunMetrics( ctx context.Context, namespaceID uint, runID string, req *request.GetRunMetricsRequest, ) ([]models.Metric, models.MetricKeysMap, error)
GetRunMetrics returns run metrics.
func (Service) GetRunsActive ¶
func (s Service) GetRunsActive( ctx context.Context, namespaceID uint, req *request.GetRunsActiveRequest, ) ([]models.Run, error)
GetRunsActive returns the active runs.
func (Service) ProcessBatch ¶
func (s Service) ProcessBatch( ctx context.Context, namespaceID uint, action string, ids []string, ) error
ProcessBatch processes runs in batch.
func (Service) SearchAlignedMetrics ¶
func (s Service) SearchAlignedMetrics( ctx context.Context, namespaceID uint, req *request.SearchAlignedMetricsRequest, ) (*sql.Rows, func(*sql.Rows) (*models.AlignedMetric, error), int, error)
SearchAlignedMetrics returns the list of aligned metrics.
func (Service) SearchMetrics ¶
func (s Service) SearchMetrics( ctx context.Context, namespaceID uint, timeZoneOffset int, req request.SearchMetricsRequest, ) (*sql.Rows, int64, repositories.SearchResultMap, error)
SearchMetrics returns the list of metrics by provided search criteria.