httpclient

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package httpclient provides basic http functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadedFile

type DownloadedFile struct {
	RemoteFileInfo RemoteFileInfo
	LocalFilePath  string
	Size           int64
	DownloadedAt   time.Time
}

DownloadedFile contains information about a file that has been downloaded to the local file system

func DownloadRemoteFile

func DownloadRemoteFile(destinationFileName string, url string) (*DownloadedFile, error)

DownloadRemoteFile retrieves a file from a url to a local file destination. On success returns information about the file in DownloadedFile

type RemoteFileInfo

type RemoteFileInfo struct {
	ETag                  string
	LastModifiedTimestamp int64
	Path                  string
}

RemoteFileInfo contains information

func GetRemoteFileInfo

func GetRemoteFileInfo(url string) (RemoteFileInfo, error)

GetRemoteFileInfo retrieves ETag and last modified timestamp from url using a HEAD request

func (*RemoteFileInfo) IsDifferent

func (df *RemoteFileInfo) IsDifferent(etag string, lastModifiedTimestamp int64) bool

Jump to

Keyboard shortcuts

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