archive

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptiveDecision added in v1.10.0

type AdaptiveDecision struct {
	Strategy    string           `json:"strategy"`
	ErrorKind   string           `json:"error_kind,omitempty"`
	TimeRange   domain.TimeRange `json:"time_range"`
	StepSeconds int              `json:"step_seconds,omitempty"`
}

type ArchiveMetadata

type ArchiveMetadata struct {
	ExportID             string             `json:"export_id"`
	ExportDate           time.Time          `json:"export_date"`
	TimeRange            domain.TimeRange   `json:"time_range"`
	Components           []string           `json:"components"`
	Jobs                 []string           `json:"jobs"`
	MetricsCount         int                `json:"metrics_count"`
	Obfuscated           bool               `json:"obfuscated"`
	InstanceMap          map[string]string  `json:"instance_map,omitempty"` // Internal use only, not included in archive
	JobMap               map[string]string  `json:"job_map,omitempty"`      // Internal use only, not included in archive
	AdaptiveMode         string             `json:"adaptive_mode,omitempty"`
	MetricStepSeconds    int                `json:"metric_step_seconds,omitempty"`
	MaxMetricStepSeconds int                `json:"max_metric_step_seconds,omitempty"`
	Sampled              bool               `json:"sampled,omitempty"`
	AdaptiveDecisions    []AdaptiveDecision `json:"adaptive_decisions,omitempty"`
	VMGatherVersion      string             `json:"vmgather_version"`
}

ArchiveMetadata contains metadata about the export Note: InstanceMap and JobMap are intentionally excluded from archive metadata per issue #10 - mapping should not be included in the archive sent to customers

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer handles archive creation for export data

func NewWriter

func NewWriter(outputDir string) *Writer

NewWriter creates a new archive writer

func (*Writer) CreateArchive

func (w *Writer) CreateArchive(
	exportID string,
	metricsReader io.Reader,
	metadata ArchiveMetadata,
) (archivePath string, sha256sum string, err error)

CreateArchive creates a ZIP archive with metrics data Returns archive path, SHA256 checksum, and error

func (*Writer) GetArchiveSize

func (w *Writer) GetArchiveSize(archivePath string) (int64, error)

GetArchiveSize returns the size of an archive file in bytes

func (*Writer) OutputDir

func (w *Writer) OutputDir() string

Jump to

Keyboard shortcuts

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