utils

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 12 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectContentType added in v1.5.0

func DetectContentType(fname string) (any, error)

DetectContentType detects the file type by reading MIME type information of the file content.

func DownloadImage

func DownloadImage(url string) (*os.File, error)

DownloadImage downloads the image from the internet and saves it into a temporary file.

func IsValidUrl

func IsValidUrl(uri string) bool

IsValidUrl tests a string to determine if it is a well-structured url or not.

Types

type ProcessIndicator added in v1.5.0

type ProcessIndicator struct {
	StopMsg string
	// contains filtered or unexported fields
}

ProcessIndicator initializes the progress indicator.

func NewIndicator added in v1.5.0

func NewIndicator(msg string, d time.Duration) *ProcessIndicator

NewIndicator instantiates a new progress indicator.

func (*ProcessIndicator) RestoreCursor added in v1.5.0

func (pi *ProcessIndicator) RestoreCursor()

RestoreCursor restores back the cursor visibility.

func (*ProcessIndicator) Start added in v1.5.0

func (pi *ProcessIndicator) Start()

Start starts the progress indicator.

func (*ProcessIndicator) Stop added in v1.5.0

func (pi *ProcessIndicator) Stop()

Stop stops the progress indicator.

Jump to

Keyboard shortcuts

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