upload

package
v0.0.0-...-27e6812 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(config *Config, files Files, dryRun, delta bool, logger io.Writer) error

Do iterates over the files concurrently and calls uploadFile for each file, printing progress indication to logger

Types

type Config

type Config struct {
	Bucket struct {
		Name      string
		Accesskey string
		Key       string
	}
	Parallel int
	Source   string
	Ignore   string
	Metadata []struct {
		Regex   string
		Headers []Header
	}
}

Config is the configuration object for the uploader

type Delta

type Delta map[string]*DeltaProperties

Delta is a mapping of files to their DeltaProperties

type DeltaProperties

type DeltaProperties struct {
	LastModified time.Time
	ETag         string
}

DeltaProperties are the properties of a file used to determine if it has been changed

type Files

type Files map[string][]Header

Files is a map from filename to a HTTP header configuration

func ParseFiles

func ParseFiles(config *Config, delta bool) (Files, error)

ParseFiles builds a metadata object based on the sourcefiles and the provided configuration, which indicates which files will get uploaded and the headers to set for those files

type Header map[string]string

Header is a simple HTTP header representation

Jump to

Keyboard shortcuts

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