downloader

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent is a new downloader agent. It will ingest the document's assets and download them.

func New

func New(client *http.Client) (*Agent, error)

New creates a new agent for use. The HTTP client provided must have oauth2 capabilities.

func (*Agent) Download

func (a *Agent) Download(dir string, doc *docs.Document) error

Download downloads all the assets to the directory that are contained the doc.

func (*Agent) Manifest

func (a *Agent) Manifest() Manifest

Manifest returns the manifest

func (*Agent) ManifestJSON

func (a *Agent) ManifestJSON() ([]byte, error)

ManifestJSON returns the manifest is JSON form

type Manifest

type Manifest map[string]ManifestFile

Manifest is just an object ID -> filename mapping.

type ManifestFile

type ManifestFile struct {
	Filename string
	Height   int64
	Width    int64
}

ManifestFile is a file with size data.

Jump to

Keyboard shortcuts

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