importer

package
v0.0.0-...-d160b6d Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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) ApplyTags

func (s *Service) ApplyTags(runs []benchmark.Run, tag *config.TagConfig) []benchmark.Run

ApplyTags applies tags to runs in the metadata

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

func (s *Service) LoadDestinationMetadata() (*benchmark.RunGroup, error)

LoadDestinationMetadata loads the existing destination metadata

func (*Service) LoadSourceMetadata

func (s *Service) LoadSourceMetadata(source string) (*benchmark.RunGroup, error)

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

func (*Service) WriteMetadata

func (s *Service) WriteMetadata(metadata *benchmark.RunGroup) error

WriteMetadata writes the merged metadata back to the output file

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

Jump to

Keyboard shortcuts

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