upload

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultCacheControl is the default value for each artifact's Cache-Control header
	DefaultCacheControl = "private"

	// DefaultConcurrency is the default number of concurrent goroutines used during upload
	DefaultConcurrency = uint64(5)

	// DefaultMaxSize is the default maximum allowed bytes for all artifacts
	DefaultMaxSize = uint64(1024 * 1024 * 1000)

	// DefaultPaths is the default slice of local paths to upload (empty)
	DefaultPaths = []string{}

	// DefaultPerm is the default ACL applied to each artifact
	DefaultPerm = "private"

	// DefaultRepoSlug is the repo slug detected from the env
	DefaultRepoSlug = ""

	// DefaultBuildNumber is the build number detected from the env
	DefaultBuildNumber = ""

	// DefaultBuildID is the build id detected from the env
	DefaultBuildID = ""

	// DefaultJobNumber is the build number detected from the env
	DefaultJobNumber = ""

	// DefaultJobID is the build id detected from the env
	DefaultJobID = ""

	// DefaultRetries is the default number of times a given artifact upload will be retried
	DefaultRetries = uint64(2)

	// DefaultTargetPaths is the default upload prefix for each artifact
	DefaultTargetPaths = []string{}

	// DefaultUploadProvider is the provider used to upload (nuts)
	DefaultUploadProvider = "s3"

	// DefaultWorkingDir is the default working directory ... wow.
	DefaultWorkingDir, _ = os.Getwd()
)

Functions

func Upload

func Upload(opts *Options, log *logrus.Logger) error

Upload does the deed!

Types

type Options

type Options struct {
	AccessKey    string
	BucketName   string
	CacheControl string
	Perm         s3.ACL
	SecretKey    string

	RepoSlug    string
	BuildNumber string
	BuildID     string
	JobNumber   string
	JobID       string

	Concurrency uint64
	MaxSize     uint64
	Paths       []string
	Provider    string
	Retries     uint64
	TargetPaths []string
	WorkingDir  string

	ArtifactsSaveHost  string
	ArtifactsAuthToken string
}

Options is used in the call to Upload

func NewOptions

func NewOptions() *Options

NewOptions makes some *Options with defaults!

func (*Options) Validate added in v0.3.0

func (opts *Options) Validate() error

Validate checks for validity!

Jump to

Keyboard shortcuts

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