downloader

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DnsTxtDownload

type DnsTxtDownload struct {
}

DnsTxtDownload is an empty struct used to satisfy the Downloader interface.

func NewDnsTxtDownloader

func NewDnsTxtDownloader() *DnsTxtDownload

Create a new DNS TXT record downloader.

func (*DnsTxtDownload) DownloadExec

func (d *DnsTxtDownload) DownloadExec(hostname string)

DownloadExec makes repeated TXT lookups to i.hostname, where i is incremented from 0 until no record is returned. The TXT record is base64 decoded and added to the data to be saved.

This excellent idea came from @breenmachine https://github.com/breenmachine/dnsftp

type Downloader

type Downloader interface {
	DownloadExec(location string)
}

Define the Downloader interface.

type HttpDownload

type HttpDownload struct {
	// contains filtered or unexported fields
}

Define an HTTP Download struct that implements the Downloader interface.

func NewHttpDownloader

func NewHttpDownloader(agent string) *HttpDownload

Create a new HTTP Downloader.

func (*HttpDownload) DownloadExec

func (h *HttpDownload) DownloadExec(url string)

Download a file from the given URL using the given User Agent.

Jump to

Keyboard shortcuts

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