net

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package net is network utilities.

Index

Constants

This section is empty.

Variables

View Source
var WithMaxRedirs = funcopt.New(func(params *fetchParams, maxredirs int) {
	params.maxredirs = maxredirs
})

WithMaxRedirs sets the maximum number of redirections to follow. Zero does not follow redirections. Negative number uses the default of the underlying library.

View Source
var WithOutput = funcopt.New(func(params *fetchParams, output string) {
	params.output = output
})

WithOutput writes output to the specified file instead of stdout.

View Source
var WithStderr = funcopt.New(func(params *fetchParams, stderr io.Writer) {
	params.stderr = stderr
})

WithStderr sets the stderr stream for the fetch operation.

View Source
var WithVerbose = funcopt.New(func(params *fetchParams, verbose bool) {
	params.verbose = verbose
})

WithVerbose sets the verbosity.

Functions

func Fetch

func Fetch(url string, opts ...funcopt.Option[fetchParams]) (err error)

Fetch downloads a file from the given URL to the local filesystem.

Types

type Options added in v0.1.12

type Options []funcopt.Option[fetchParams]

Options is functional options type

Jump to

Keyboard shortcuts

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