export

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFormatterForFormat

func GetFormatterForFormat(format ExportFormat, options map[string]interface{}) (interface{}, error)

GetFormatterForFormat returns the appropriate formatter for the given format

Types

type CSVFormatter

type CSVFormatter struct {
	IncludeHeaders bool
	CustomColumns  []string
}

CSVFormatter handles CSV export formatting

func (*CSVFormatter) FormatCSV

func (f *CSVFormatter) FormatCSV(data *ExportData, writer io.Writer) error

FormatCSV exports executions in CSV format

type ConsoleProgressReporter

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

ConsoleProgressReporter implements progress reporting to console

func (*ConsoleProgressReporter) Finish

func (p *ConsoleProgressReporter) Finish(success bool, message string)

Finish completes progress reporting

func (*ConsoleProgressReporter) Start

func (p *ConsoleProgressReporter) Start(total int)

Start begins progress reporting

func (*ConsoleProgressReporter) Update

func (p *ConsoleProgressReporter) Update(current int, message string)

Update reports progress

type ExportData

type ExportData struct {
	Metadata   ExportMetadata                   `json:"metadata"`
	Executions []logging.WafflesExecution       `json:"executions"`
	Files      map[string][]logging.WafflesFile `json:"files,omitempty"`
	Steps      map[string][]logging.WafflesStep `json:"steps,omitempty"`
	Statistics *logging.ExecutionStats          `json:"statistics,omitempty"`
}

ExportData represents the complete export data structure

type ExportFormat

type ExportFormat string

ExportFormat represents different export formats

const (
	FormatJSON     ExportFormat = "json"
	FormatCSV      ExportFormat = "csv"
	FormatMarkdown ExportFormat = "markdown"
	FormatSQL      ExportFormat = "sql"
	FormatTemplate ExportFormat = "template"
)

type ExportMetadata

type ExportMetadata struct {
	ExportedAt    time.Time    `json:"exported_at"`
	Format        ExportFormat `json:"format"`
	RecordCount   int          `json:"record_count"`
	FilterApplied bool         `json:"filter_applied"`
	Version       string       `json:"version"`
}

ExportMetadata contains information about the export

type ExportOptions

type ExportOptions struct {
	Format       ExportFormat             `json:"format"`
	Filter       *logging.ExecutionFilter `json:"filter,omitempty"`
	IncludeFiles bool                     `json:"include_files"`
	IncludeSteps bool                     `json:"include_steps"`
	IncludeStats bool                     `json:"include_stats"`
	Compress     bool                     `json:"compress"`
	Template     string                   `json:"template,omitempty"`
	TemplateData map[string]interface{}   `json:"template_data,omitempty"`
}

ExportOptions contains options for exporting data

type Exporter

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

Exporter handles the export process with progress indication and streaming

func NewExporter

func NewExporter(queryEngine *query.QueryEngine, options *ExportOptions) *Exporter

NewExporter creates a new exporter

func (*Exporter) Export

func (e *Exporter) Export(writer io.Writer) error

Export performs the complete export process

func (*Exporter) ExportToFile

func (e *Exporter) ExportToFile(filename string) error

ExportToFile exports data directly to a file

func (*Exporter) SetProgressReporter

func (e *Exporter) SetProgressReporter(reporter ProgressReporter)

SetProgressReporter sets a custom progress reporter

type JSONFormatter

type JSONFormatter struct {
	Pretty bool
}

JSONFormatter handles JSON export formatting

func (*JSONFormatter) FormatJSON

func (f *JSONFormatter) FormatJSON(data *ExportData, writer io.Writer) error

FormatJSON exports data in JSON format

type MarkdownFormatter

type MarkdownFormatter struct {
	Title        string
	IncludeStats bool
	IncludeTOC   bool
}

MarkdownFormatter handles Markdown export formatting

func (*MarkdownFormatter) FormatMarkdown

func (f *MarkdownFormatter) FormatMarkdown(data *ExportData, writer io.Writer) error

FormatMarkdown exports data in Markdown format

type ProgressReporter

type ProgressReporter interface {
	Start(total int)
	Update(current int, message string)
	Finish(success bool, message string)
}

ProgressReporter interface for progress reporting during exports

type SQLFormatter

type SQLFormatter struct {
	TableName     string
	IncludeSchema bool
	BatchSize     int
}

SQLFormatter handles SQL export formatting

func (*SQLFormatter) FormatSQL

func (f *SQLFormatter) FormatSQL(data *ExportData, writer io.Writer) error

FormatSQL exports data as SQL INSERT statements

type SilentProgressReporter

type SilentProgressReporter struct{}

SilentProgressReporter implements silent progress reporting

func (*SilentProgressReporter) Finish

func (p *SilentProgressReporter) Finish(success bool, message string)

func (*SilentProgressReporter) Start

func (p *SilentProgressReporter) Start(total int)

func (*SilentProgressReporter) Update

func (p *SilentProgressReporter) Update(current int, message string)

type TemplateFormatter

type TemplateFormatter struct {
	Template string
	FuncMap  template.FuncMap
}

TemplateFormatter handles custom template formatting

func (*TemplateFormatter) FormatTemplate

func (f *TemplateFormatter) FormatTemplate(data *ExportData, writer io.Writer) error

FormatTemplate exports data using a custom Go template

Jump to

Keyboard shortcuts

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