run

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BatchActionDelete  = "delete"
	BatchActionArchive = "archive"
	BatchActionRestore = "restore"
)

allowed batch actions.

Variables

View Source
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.

func (Service) SearchRuns

func (s Service) SearchRuns(
	ctx context.Context, namespaceID uint, tzOffset int, req request.SearchRunsRequest,
) ([]models.Run, int64, error)

SearchRuns returns the list of runs by provided search criteria.

func (Service) UpdateRun

func (s Service) UpdateRun(
	ctx context.Context, namespaceID uint, req *request.UpdateRunRequest,
) error

UpdateRun updates requested run.

Jump to

Keyboard shortcuts

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