network

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

The network package provides functionality for interacting with remote servers and downloading files.

Index

Constants

View Source
const AutoDetectFilename = ""

Callers can use this constant for the Filename field of DownloadedFile to specify that the output filename should be auto-detected from the URL

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadedFile

type DownloadedFile struct {

	// The URL from which the file is downloaded
	URL string

	// The filename used to store the file contents on the local filesystem
	Filename string

	// The Go module (if any) for which the file will be downloaded
	Module *module.Module
}

Represents a file that is downloaded from a URL

func (*DownloadedFile) Download

func (file *DownloadedFile) Download() error

Downloads the file

func (*DownloadedFile) Exists

func (file *DownloadedFile) Exists() bool

Determines if the file has already been downloaded

func (*DownloadedFile) LocalPath

func (file *DownloadedFile) LocalPath() string

Returns the absolute filesystem path for the local copy of the file

type PlatformSpecificURL

type PlatformSpecificURL struct {
	Pattern    string
	Substrings map[string][]string
}

Represents a URL that contains platform-specific substrings

func (*PlatformSpecificURL) ResolveForPlatform

func (url *PlatformSpecificURL) ResolveForPlatform(platform string, architecture string) string

Resolves the URL for the specified platform

Jump to

Keyboard shortcuts

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