utilhttp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package utilhttp contains some internal download functions utilized by the primary mobsql app logic.

Package utilhttp contains some internal download functions utilized by the primary mobsql app logic.

Index

Constants

View Source
const (
	TimeFileFormat = "20060102150405"
)

Variables

View Source
var DefaultDownloadTimeoutSeconds = 60 * 60

Functions

func DownloadURICachedFilepath

func DownloadURICachedFilepath(
	fileExpirySeconds int,
	httpTimeoutSeconds int,
	filepathPrefix, uri, extension string,
) (string, bool, error)

DownloadURICachedFilepath downloads the passed URI and caches into a file with a checksummed name. Running this same function twice for the same input URI will nop download and just return the previously downloaded filepath.

The return values are:

The determined filepath, whether a downloaded occured, errorcode

Types

type Headers

type Headers struct {
	Filesize *int
}
func Head(url string, timeoutSeconds int) (*Headers, error)

Jump to

Keyboard shortcuts

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