utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorRed    = "\033[0;31m"
	ColorGreen  = "\033[0;32m"
	ColorYellow = "\033[1;33m"
	ColorBlue   = "\033[0;34m"
)

ANSI color codes

Variables

This section is empty.

Functions

func Colorize

func Colorize(color, text string) string

Colorize adds color to text

func CopyFile added in v1.1.0

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst

func EnsureDir

func EnsureDir(path string) error

EnsureDir creates a directory if it doesn't exist

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists

func ReadLine

func ReadLine(prompt string) (string, error)

ReadLine reads a line of text from stdin

func ReadPassword

func ReadPassword(prompt string) (string, error)

ReadPassword reads a password from stdin without echoing

Types

type FileInfo

type FileInfo struct {
	Path         string
	Size         int64
	Lines        int
	LastModified time.Time
}

FileInfo represents metadata about a file

func GetFileInfo

func GetFileInfo(path string) (*FileInfo, error)

GetFileInfo retrieves metadata about a file

Jump to

Keyboard shortcuts

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