http

package
v0.182.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 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, upload *config.Upload, kind string) error

CheckConfig validates an upload configuration returning a descriptive error when appropriate.

func Defaults

func Defaults(uploads []config.Upload) error

Defaults sets default configuration options on upload structs.

func Upload

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

Upload does the actual uploading work.

Types

type ResponseChecker

type ResponseChecker func(*h.Response) error

ResponseChecker is a function capable of validating an http server response. It must return and 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