Documentation
¶
Index ¶
- Constants
- type BenchmarkRunOption
- type ImportRequest
- type ImportResult
- type ImportSummary
- type InteractivePromptState
- type Service
- func (s *Service) ApplyTags(runs []benchmark.Run, tag *config.TagConfig) []benchmark.Run
- func (s *Service) FillMissingSourceTags(runs []benchmark.Run, tag *config.TagConfig) []benchmark.Run
- func (s *Service) Import(request *ImportRequest) (*ImportResult, error)
- func (s *Service) LoadDestinationMetadata() (*benchmark.RunGroup, error)
- func (s *Service) LoadSourceMetadata(source string) (*benchmark.RunGroup, error)
- func (s *Service) MergeMetadata(srcMetadata, destMetadata *benchmark.RunGroup, ...) (*benchmark.RunGroup, *ImportSummary)
- func (s *Service) WriteMetadata(metadata *benchmark.RunGroup) error
- type TagFormData
Constants ¶
const ( StepSelectSrcTag = iota StepSelectDestTag StepSelectBenchmarkRun StepConfirm StepComplete )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BenchmarkRunOption ¶
type BenchmarkRunOption int
BenchmarkRunOption represents how to handle BenchmarkRun for imported runs
const ( BenchmarkRunAddToLast BenchmarkRunOption = iota BenchmarkRunCreateNew )
func RunInteractive ¶
func RunInteractive(summary *ImportSummary, destMetadata *benchmark.RunGroup) (*config.TagConfig, *config.TagConfig, BenchmarkRunOption, bool, error)
RunInteractive runs the interactive prompt and returns the configured tags
type ImportRequest ¶
type ImportRequest struct {
SourceMetadata *benchmark.RunGroup
DestMetadata *benchmark.RunGroup
SrcTag *config.TagConfig
DestTag *config.TagConfig
BenchmarkRunOpt BenchmarkRunOption
NoConfirm bool
}
ImportRequest represents a request to import runs
type ImportResult ¶
type ImportResult struct {
ImportedRuns int
UpdatedRuns int
TotalRuns int
Success bool
Error error
}
ImportResult represents the result of an import operation
type ImportSummary ¶
type ImportSummary struct {
ImportedRunsCount int
ExistingRunsCount int
SrcTagApplied *config.TagConfig
DestTagApplied *config.TagConfig
Conflicts []string
}
ImportSummary provides a summary of changes to be made
type InteractivePromptState ¶
type InteractivePromptState struct {
CurrentStep int
SrcTag *config.TagConfig
DestTag *config.TagConfig
BenchmarkRunOpt BenchmarkRunOption
Confirmed bool
Cancelled bool
}
InteractivePromptState represents the state of interactive prompts
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles importing benchmark runs from files or URLs
func NewService ¶
func NewService(cfg *config.ImportCmdConfig, log log.Logger) *Service
NewService creates a new import service
func (*Service) FillMissingSourceTags ¶
func (s *Service) FillMissingSourceTags(runs []benchmark.Run, tag *config.TagConfig) []benchmark.Run
FillMissingSourceTags fills in missing source tags without overwriting existing values
func (*Service) Import ¶
func (s *Service) Import(request *ImportRequest) (*ImportResult, error)
Import performs the complete import operation
func (*Service) LoadDestinationMetadata ¶
LoadDestinationMetadata loads the existing destination metadata
func (*Service) LoadSourceMetadata ¶
LoadSourceMetadata loads metadata from a file or URL
func (*Service) MergeMetadata ¶
func (s *Service) MergeMetadata(srcMetadata, destMetadata *benchmark.RunGroup, srcTag, destTag *config.TagConfig, benchmarkRunOpt BenchmarkRunOption) (*benchmark.RunGroup, *ImportSummary)
MergeMetadata merges source metadata into destination metadata
type TagFormData ¶
type TagFormData struct {
BenchmarkRunMode string // "last" or "new"
SrcKey string
SrcValue string
DestValue string // Same key as source, only value differs
NeedsDestTag bool // Whether destination tag is needed
Confirm bool
}
TagFormData holds the form data for tag configuration