utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Sleep interval to avoid rate-limit.
	DefaultInterval = time.Millisecond * 300
)

Variables

View Source
var (
	Version = "0.1.0"
	Commit  = "HEAD"
)

Functions

func CheckFileExistsPrompt

func CheckFileExistsPrompt(
	ctx context.Context, name string, autoYes bool,
) error

func DetectURLType

func DetectURLType(rawURL string) string

func DoHTTPRequest

func DoHTTPRequest(req *http.Request, insecure bool) (*http.Response, error)

func MatchFilters

func MatchFilters(s string, filters []string) bool

func Pointer

func Pointer[T valueTypes](i T) *T

Pointer gets the pointer of the variable.

func Print

func Print(a any) string

func PrintNoIndent

func PrintNoIndent(a any) string

func Scanf

func Scanf(ctx context.Context, format string, a ...any) (int, error)

func SetupLogrus

func SetupLogrus()

func UTCTimestamp

func UTCTimestamp() int64

func Value

func Value[T valueTypes](p *T) T

A safe function to get the value from the pointer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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