export

package
v2.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDefaultExportFileName

func GenerateDefaultExportFileName(executionName, fileExtension string) string

func Write

func Write(filePath string, exportData io.Reader) error

Types

type ExportSourceData

type ExportSourceData interface {
	IsExportSourceData()
}

ExportSourceData is an interface implemented by all types which can be used as an input to an exporter

type Exporter

type Exporter interface {
	Export(ctx context.Context, input ExportSourceData, destPath string) error
	FileExtension() string
	Name() string
	Alias() string
}

type ExporterBase

type ExporterBase struct{}

func (*ExporterBase) Alias

func (*ExporterBase) Alias() string

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) DoExport

func (m *Manager) DoExport(ctx context.Context, targetName string, source ExportSourceData, exports []string) ([]string, error)

func (*Manager) HasNamedExport

func (m *Manager) HasNamedExport(exports []string) bool

HasNamedExport returns true if any of the export arguments has a filename (--export=file.json) instead of the format name (--export=json) panics if a target is not valid

func (*Manager) Register

func (m *Manager) Register(exporter Exporter) error

func (*Manager) ValidateExportFormat

func (m *Manager) ValidateExportFormat(exports []string) error

type SnapshotExporter

type SnapshotExporter struct {
	ExporterBase
}

func (*SnapshotExporter) Alias

func (*SnapshotExporter) Alias() string

func (*SnapshotExporter) Export

func (e *SnapshotExporter) Export(_ context.Context, input ExportSourceData, filePath string) error

func (*SnapshotExporter) FileExtension

func (e *SnapshotExporter) FileExtension() string

func (*SnapshotExporter) Name

func (e *SnapshotExporter) Name() string

type Target

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

func (*Target) Export

func (t *Target) Export(ctx context.Context, input ExportSourceData) (string, error)

Jump to

Keyboard shortcuts

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