utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(filename, content string) error

AppendToFile appends content to a file

func CalculateHash

func CalculateHash(content string) string

CalculateHash calculates SHA256 hash of content

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists

func FormatBytes

func FormatBytes(bytes int) string

FormatBytes formats bytes to human readable format

func LoadURLsFromFile

func LoadURLsFromFile(filename string) ([]string, error)

LoadURLsFromFile loads URLs from a file

func SaveDiff

func SaveDiff(jsURL, oldContent, newContent string) error

SaveDiff saves a diff between old and new content

func TruncateString

func TruncateString(s string, maxLen int) string

TruncateString truncates a string to specified length

Types

type Logger

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

Logger provides colored logging functionality

func NewLogger

func NewLogger(verbose, silent bool) *Logger

NewLogger creates a new Logger instance

func (*Logger) Debug

func (l *Logger) Debug(message string)

Debug logs a debug message (only in verbose mode)

func (*Logger) Error

func (l *Logger) Error(message string)

Error logs an error message

func (*Logger) Info

func (l *Logger) Info(message string)

Info logs an info message

func (*Logger) Success

func (l *Logger) Success(message string)

Success logs a success message

func (*Logger) Warning

func (l *Logger) Warning(message string)

Warning logs a warning message

Jump to

Keyboard shortcuts

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