cache

package
v1.2.1-2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cache provides functionality for working with an on-disk cache of the ECS Agent image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

Downloader is resposible for cache operations relating to downloading the agent

func NewDownloader

func NewDownloader() *Downloader

NewDownloader returns a Downloader with default dependencies

func (*Downloader) DownloadAgent

func (d *Downloader) DownloadAgent() error

DownloadAgent downloads a fresh copy of the Agent and performs an integrity check on the downloaded image

func (*Downloader) IsAgentCached

func (d *Downloader) IsAgentCached() bool

IsAgentCached returns true if there is a cached copy of the Agent present and a cache state file is not empty (no validation is performed on the tarball or cache state file contents)

func (*Downloader) LoadCachedAgent

func (d *Downloader) LoadCachedAgent() (io.ReadCloser, error)

LoadCachedAgent returns an io.ReadCloser of the Agent from the cache

func (*Downloader) LoadDesiredAgent

func (d *Downloader) LoadDesiredAgent() (io.ReadCloser, error)

LoadDesiredAgent returns an io.ReadCloser of the Agent indicated by the desiredImageLocatorFile (/var/cache/ecs/desired-image). The desiredImageLocatorFile must contain as the beginning of the file the name of the file containing the desired image (interpreted as a basename) and ending in a newline. Only the first line is read, with the rest of the file reserved for future use.

func (*Downloader) RecordCachedAgent

func (d *Downloader) RecordCachedAgent() error

Jump to

Keyboard shortcuts

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