Documentation
¶
Index ¶
- func Colorize(text string, color ColorCode) string
- func FormatBytes(bytes int64) string
- func FormatDuration(d time.Duration) string
- type ColorCode
- type DeviceInfo
- type OutputFormat
- type OutputWriter
- func (ow *OutputWriter) Flush() error
- func (ow *OutputWriter) WriteDeviceInfo(info DeviceInfo) error
- func (ow *OutputWriter) WriteDevices(devices []*model.Device, method string) error
- func (ow *OutputWriter) WriteError(err error)
- func (ow *OutputWriter) WriteMessage(message string)
- func (ow *OutputWriter) WriteProgress(message string)
- func (ow *OutputWriter) WriteSuccess(message string)
- func (ow *OutputWriter) WriteWarning(message string)
- type ProgressBar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
FormatBytes formats bytes in human readable format
func FormatDuration ¶
FormatDuration formats duration in human readable format
Types ¶
type ColorCode ¶
type ColorCode string
ColorCode represents ANSI color codes
const ( ColorReset ColorCode = "\033[0m" ColorRed ColorCode = "\033[31m" ColorGreen ColorCode = "\033[32m" ColorYellow ColorCode = "\033[33m" ColorBlue ColorCode = "\033[34m" ColorPurple ColorCode = "\033[35m" ColorCyan ColorCode = "\033[36m" ColorWhite ColorCode = "\033[37m" ColorBold ColorCode = "\033[1m" )
type DeviceInfo ¶
type DeviceInfo struct {
Alias string `json:"alias"`
Version string `json:"version"`
DeviceModel string `json:"deviceModel"`
DeviceType string `json:"deviceType"`
Fingerprint string `json:"fingerprint"`
Port int `json:"port"`
Protocol string `json:"protocol"`
DownloadDir string `json:"downloadDir"`
HasPin bool `json:"hasPin"`
MulticastAddr string `json:"multicastAddr"`
}
DeviceInfo represents device information for output
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the output format type
const ( FormatJSON OutputFormat = "json" FormatTable OutputFormat = "table" FormatQuiet OutputFormat = "quiet" )
type OutputWriter ¶
type OutputWriter struct {
// contains filtered or unexported fields
}
OutputWriter handles different output formats
func NewOutputWriter ¶
func NewOutputWriter(format OutputFormat) *OutputWriter
NewOutputWriter creates a new output writer
func (*OutputWriter) WriteDeviceInfo ¶
func (ow *OutputWriter) WriteDeviceInfo(info DeviceInfo) error
WriteDeviceInfo outputs device information
func (*OutputWriter) WriteDevices ¶
func (ow *OutputWriter) WriteDevices(devices []*model.Device, method string) error
WriteDevices outputs a list of devices in the specified format
func (*OutputWriter) WriteError ¶
func (ow *OutputWriter) WriteError(err error)
WriteError outputs an error message
func (*OutputWriter) WriteMessage ¶
func (ow *OutputWriter) WriteMessage(message string)
WriteMessage outputs a simple message
func (*OutputWriter) WriteProgress ¶
func (ow *OutputWriter) WriteProgress(message string)
WriteProgress outputs progress information
func (*OutputWriter) WriteSuccess ¶
func (ow *OutputWriter) WriteSuccess(message string)
WriteSuccess outputs a success message
func (*OutputWriter) WriteWarning ¶
func (ow *OutputWriter) WriteWarning(message string)
WriteWarning outputs a warning message
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar represents a simple progress bar
func NewProgressBar ¶
func NewProgressBar(total int64, prefix string) *ProgressBar
NewProgressBar creates a new progress bar
func (*ProgressBar) Update ¶
func (pb *ProgressBar) Update(current int64)
Update updates the progress bar