util

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

Package util implements utility functions

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDownloadFailed = fmt.Errorf("downloading file failed")    //nolint:revive
	ErrWritingFile    = fmt.Errorf("opening output file failed") //nolint:revive
)

Functions

func Download added in v0.5.3

func Download(ctx context.Context, url string, output string) error

Download downloads a file from a URL and saves it to the output file.

func ParseLogLevel added in v0.5.8

func ParseLogLevel(levelString string) (slog.Level, error)

ParseLogLevel parses the level from a string

func URLFromFilePath

func URLFromFilePath(path string) (*url.URL, error)

URLFromFilePath converts the given absolute path to a URL.

func URLToFilePath

func URLToFilePath(u *url.URL) (string, error)

URLToFilePath converts a file-scheme url to a file path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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