adapter

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExcelPath added in v0.1.1

func GetExcelPath(jsonChunkPath string) string

GetExcelPath returns the Excel output path for a JSON chunk directory

func GetJSONPath

func GetJSONPath(excelPath string) string

GetJSONPath returns the JSON output path for an Excel file

func IsUpToDate

func IsUpToDate(excelPath, jsonPath string) bool

IsUpToDate checks if the JSON chunks are up to date with the Excel file

func ValidatePattern

func ValidatePattern(pattern string) error

ValidatePattern checks if a file pattern is valid

Types

type ConfigAdapter

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

ConfigAdapter bridges the TUI setup wizard with the config package

func NewConfigAdapter

func NewConfigAdapter(directory string) *ConfigAdapter

func (*ConfigAdapter) CreateGitIgnore

func (ca *ConfigAdapter) CreateGitIgnore(directory string) error

CreateGitIgnore creates a .gitignore file with Excel patterns

func (*ConfigAdapter) LoadConfig

func (ca *ConfigAdapter) LoadConfig() (*config.Config, error)

LoadConfig loads existing configuration

func (*ConfigAdapter) SaveSetupConfig

func (ca *ConfigAdapter) SaveSetupConfig(setup types.SetupConfig) error

SaveSetupConfig converts TUI setup config to internal config format and saves it

type ConversionResult

type ConversionResult struct {
	ExcelPath string
	JSONPath  string
	Success   bool
	Error     error
}

ConversionResult contains the result of a conversion operation

type ConversionStats

type ConversionStats struct {
	TotalExcelFiles    int
	ConvertedFiles     int
	PendingConversions int
	FailedConversions  int
	TotalJSONSize      int64
}

ConversionStats contains statistics about conversions

type ConverterAdapter

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

ConverterAdapter bridges the TUI with the converter package

func NewConverterAdapter

func NewConverterAdapter() *ConverterAdapter

func (*ConverterAdapter) ConvertFile

func (ca *ConverterAdapter) ConvertFile(excelPath string) (*ConversionResult, error)

ConvertFile converts a single Excel file to JSON

func (*ConverterAdapter) ConvertFileWithSheetOptions

func (ca *ConverterAdapter) ConvertFileWithSheetOptions(excelPath string, sheetOptions SheetSelectionOptions) (*ConversionResult, error)

ConvertFileWithSheetOptions converts a single Excel file to JSON with sheet selection options

func (*ConverterAdapter) ConvertJSONToExcel added in v0.1.1

func (ca *ConverterAdapter) ConvertJSONToExcel(jsonPath string) (*ConversionResult, error)

ConvertJSONToExcel converts a JSON file back to Excel

func (*ConverterAdapter) GetConversionStats

func (ca *ConverterAdapter) GetConversionStats(directory string) (*ConversionStats, error)

GetConversionStats returns statistics about conversions

func (*ConverterAdapter) GetExcelSheets

func (ca *ConverterAdapter) GetExcelSheets(excelPath string) ([]SheetInfo, error)

GetExcelSheets returns a list of sheet names and indices from an Excel file

func (*ConverterAdapter) GetPendingConversions

func (ca *ConverterAdapter) GetPendingConversions(directory string, pattern string) ([]string, error)

GetPendingConversions returns list of Excel files that need conversion

type GitAdapter

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

GitAdapter provides minimal git operations for GitCells TUI Users should use their preferred git tools for all git operations

func NewGitAdapter

func NewGitAdapter(directory string) (*GitAdapter, error)

func (*GitAdapter) CommitFiles

func (ga *GitAdapter) CommitFiles(files []string, message string) error

CommitFiles commits the specified files with a simple message

func (*GitAdapter) InGitRepository

func (ga *GitAdapter) InGitRepository() bool

InGitRepository returns true if we're in a git repository

func (*GitAdapter) IsClean

func (ga *GitAdapter) IsClean() (bool, error)

IsClean returns true if the working directory is clean

type SheetInfo

type SheetInfo struct {
	Name  string
	Index int
}

SheetInfo contains information about a sheet in an Excel file

type SheetSelectionOptions

type SheetSelectionOptions struct {
	SheetsToConvert []string // Specific sheet names to convert
	ExcludeSheets   []string // Sheet names to exclude
	SheetIndices    []int    // Specific sheet indices to convert (0-based)
}

SheetSelectionOptions contains options for selecting specific sheets

type WatcherAdapter added in v0.1.4

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

WatcherAdapter bridges the TUI with the watcher package

func NewWatcherAdapter added in v0.1.4

func NewWatcherAdapter(cfg *config.Config, logger *logrus.Logger, onEvent func(WatcherEvent)) (*WatcherAdapter, error)

NewWatcherAdapter creates a new watcher adapter

func (*WatcherAdapter) GetStatus added in v0.1.4

func (wa *WatcherAdapter) GetStatus() WatcherStatus

GetStatus returns the current watcher status

func (*WatcherAdapter) IsRunning added in v0.1.4

func (wa *WatcherAdapter) IsRunning() bool

IsRunning returns whether the watcher is currently running

func (*WatcherAdapter) Start added in v0.1.4

func (wa *WatcherAdapter) Start() error

Start starts the file watcher

func (*WatcherAdapter) Stop added in v0.1.4

func (wa *WatcherAdapter) Stop() error

Stop stops the file watcher

type WatcherEvent added in v0.1.4

type WatcherEvent struct {
	Type      string // "started", "stopped", "file_changed", "error"
	Message   string
	Details   string
	Timestamp time.Time
	FilePath  string
}

WatcherEvent represents a watcher event for the TUI

type WatcherStatus added in v0.1.4

type WatcherStatus struct {
	IsRunning     bool
	StartTime     time.Time
	FilesWatched  int
	LastEvent     string
	LastEventTime time.Time
	Directories   []string
}

WatcherStatus represents the current status of the watcher

Jump to

Keyboard shortcuts

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