core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package core provides core functionality for flashingestor including directory management, logging, and event handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration into a human-readable string

func FormatFileSize

func FormatFileSize(bytes int64) string

FormatFileSize formats bytes into human-readable size string.

func OpenLogFile

func OpenLogFile(filename string) (*os.File, error)

OpenLogFile opens a log file for appending.

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

type Directories struct {
	LDAP       string
	Remote     string
	BloodHound string
}

Directories holds paths to output directories.

func SetupDirectories

func SetupDirectories(baseDir string) (*Directories, error)

SetupDirectories creates the required output directory structure.

type LogMessage

type LogMessage struct {
	Message string
	Level   int
}

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.

func (*Logger) Log0 added in v0.2.0

func (l *Logger) Log0(format string, args ...interface{})

Log0 sends a normal log message (level 0).

func (*Logger) Log1 added in v0.2.0

func (l *Logger) Log1(format string, args ...interface{})

Log1 sends a verbose log message (level 1).

func (*Logger) Log2 added in v0.2.0

func (l *Logger) Log2(format string, args ...interface{})

Log2 sends a debug log message (level 2).

func (*Logger) Start

func (l *Logger) Start()

Start begins processing log messages.

type RemoteCollectionUpdate

type RemoteCollectionUpdate struct {
	Step      int
	Status    string
	Processed int
	Total     int
	Percent   float64
	Speed     string
	AvgSpeed  string
	Success   string
	ETA       string
	Elapsed   string
}

RemoteCollectionUpdate represents a progress update from the remote collection process

Jump to

Keyboard shortcuts

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