internal

package
v0.0.0-...-a6dfa66 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWithContext

func CopyWithContext(ctx context.Context, dst io.Writer, src io.Reader) (err error)

CopyWithContext is a custom implementation of io.Copy that is cancellable.

func DefaultBytes

func DefaultBytes(maxBytes int64, description string) *progressbar.ProgressBar

DefaultBytes is equivalent to progressbar.DefaultBytes but with higher progressbar.OptionThrottle.

func MkExclDir

func MkExclDir(stem string) (name string, err error)

MkExclDir creates a new directory with the condition that the directory did not exist prior to this call.

Stem is the desired name of the directory. The actual directory that is created might have numeric suffixes in its name which is the first return value.

func NewLogger

func NewLogger(i, n int, name flags.Filename) *log.Logger

NewLogger creates a new logger with a prefix set.

func OpenExclFile

func OpenExclFile(stem, ext string) (file *os.File, err error)

OpenExclFile creates a new file for writing with the condition that the file did not exist prior to this call.

The first string should be the stem of the filename, the second the extension. If filename is "hello world.txt" then the stem is "hello world", ext is ".txt". See os.O_EXCL. Caller is responsible for closing the file upon a successful return.

func SplitStemAndExt

func SplitStemAndExt(name string) (stem string, ext string)

SplitStemAndExt splits the given name into the stem and extension part.

The extension starts at the final dot. If there is no dot, ext is empty string.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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