Documentation
¶
Overview ¶
Package core provides core functionality for flashingestor including directory management, logging, and event handling.
Index ¶
- func FormatDuration(d time.Duration) string
- func FormatFileSize(bytes int64) string
- func GetVerbosity() int
- func OpenLogFile(filename string) (*os.File, error)
- func SetVerbosity(level int)
- func VerbosityString(level int) string
- type ConversionUpdate
- type Directories
- type LogMessage
- type Logger
- type RemoteCollectionUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
FormatDuration formats a duration into a human-readable string
func FormatFileSize ¶
FormatFileSize formats bytes into human-readable size string.
func GetVerbosity ¶ added in v0.3.1
func GetVerbosity() int
GetVerbosity returns the current verbosity level.
func OpenLogFile ¶
OpenLogFile opens a log file for appending.
func SetVerbosity ¶ added in v0.3.1
func SetVerbosity(level int)
SetVerbosity changes the verbosity level at runtime for all loggers. Valid range is 0-2 (0=normal, 1=verbose, 2=debug).
func VerbosityString ¶ added in v0.3.1
Types ¶
type ConversionUpdate ¶
type ConversionUpdate struct {
Step int
Status string
Processed int
Total int
Percent float64
Speed string
AvgSpeed string
ETA string
Elapsed string
}
ConversionUpdate represents a progress update from the conversion process
type Directories ¶
Directories holds paths to output directories.
func SetupDirectories ¶
func SetupDirectories(baseDir string) (*Directories, error)
SetupDirectories creates the required output directory structure.
type LogMessage ¶
LogMessage represents a log entry with level
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger handles message logging to both UI and file.
func NewLogger ¶
func NewLogger(channel chan LogMessage, file *os.File, logCallback func(string), verboseLevel int) *Logger
NewLogger creates a new logger instance and initializes the global verbosity level.