http

package
v0.80.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package http implements functionality common to HTTP uploading pipelines.

Index

Constants

View Source
const (
	// ModeBinary uploads only compiled binaries
	ModeBinary = "binary"
	// ModeArchive uploads release archives
	ModeArchive = "archive"
)

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig(ctx *context.Context, put *config.Put, kind string) error

CheckConfig validates a Put configuration returning a descriptive error when appropriate

func Defaults

func Defaults(puts []config.Put) error

Defaults sets default configuration options on Put structs

func Upload

func Upload(ctx *context.Context, puts []config.Put, kind string, check ResponseChecker) error

Upload does the actual uploading work

Types

type ResponseChecker

type ResponseChecker func(*h.Response) (string, error)

ResponseChecker is a function capable of validating an http server response. It must return the location of the uploaded asset or the error when the response must be considered a failure.

Jump to

Keyboard shortcuts

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