file

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const URL_PATTERN = "%s/%s/%s/%s"

Variables

This section is empty.

Functions

func Matches added in v0.0.5

func Matches(fileFullName, productSlug, pattern, version string) (bool, error)

func Sign

func Sign(req *request.Request)

Sign requests with signature version 2.

Will sign the requests with the service config's Credentials object Signing is skipped if the credentials is the credentials.AnonymousCredentials object.

Types

type HTTPProvider added in v0.0.4

type HTTPProvider struct {
	BaseURL        string
	HTTPClient     *http.Client
	Bar            bar
	ProgressWriter io.Writer
	Logger         logger.Logger
}

func (*HTTPProvider) ContentURL added in v0.0.4

func (h *HTTPProvider) ContentURL(slug, version, pattern string) string

func (*HTTPProvider) Download added in v0.0.4

func (h *HTTPProvider) Download(
	targetFile string,
	contentURL string,
) error

func (*HTTPProvider) DownloadFile added in v0.0.4

func (h *HTTPProvider) DownloadFile(targetDirectory, productSlug, version, pattern string, unpack bool) error

func (*HTTPProvider) FileName added in v0.0.4

func (h *HTTPProvider) FileName(version, pattern string) string

type PivnetProvider

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

func (*PivnetProvider) DownloadFile

func (p *PivnetProvider) DownloadFile(targetDirectory, productSlug, version, pattern string, unpack bool) error

DownloadFile - Downloads file based on version info

type Provider

type Provider interface {
	DownloadFile(targetDirectory, productSlug, version, pattern string, unpack bool) error
}

Provider - defines the interface for how to fetch configuration

func FromSource

func FromSource(source types.Source) (Provider, error)

FromSource - factory to return appropriate driver based on configuration

func NewHTTPProvider added in v0.0.4

func NewHTTPProvider(skipSSLValidation bool, baseURL string) (Provider, error)

func NewPivnetProvider

func NewPivnetProvider(token string) (Provider, error)

func NewS3Provider

func NewS3Provider(accessKeyID, secretAccessKey, regionName, endpoint, bucketName string, skipSSLVerification, disableSSL, useV2Signing bool) (Provider, error)

type S3Provider

type S3Provider struct {
	Client         s3iface.S3API
	ProgressOutput io.Writer
	BucketName     string
}

func (*S3Provider) DownloadFile

func (p *S3Provider) DownloadFile(targetDirectory, productSlug, version, pattern string, unpack bool) error

DownloadFile - Downloads file based on version info

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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