util

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogIndividualTransfers = parseBool(os.Getenv("LOG_TRANSFERS"))

LogIndividualTransfers is set to the boolean value of the LOG_TRANSFERS environment variable.

View Source
var Version string

Version is the version number of swift-http-import.

Functions

func EnhancedGet

func EnhancedGet(client *http.Client, uri string, requestHeaders http.Header, segmentBytes uint64) (*http.Response, error)

EnhancedGet is like http.Client.Get(), but recognizes if the HTTP server understands range requests, and downloads the file in segments in that case.

func VerifyClearSignedGPGSignature

func VerifyClearSignedGPGSignature(keyring *GPGKeyRing, messageWithSignature []byte) error

VerifyClearSignedGPGSignature takes a clear signed message and a GPGKeyRing to check if the signature is valid. If the key ring does not contain the concerning public key then the key is downloaded from a pool server and added to the existing key ring. A non-nil error is returned, if signature verification was unsuccessful.

func VerifyDetachedGPGSignature

func VerifyDetachedGPGSignature(keyring *GPGKeyRing, message, armoredSignature []byte) error

VerifyDetachedGPGSignature takes a message, a detached signature, and a GPGKeyRing to check if the signature is valid. The detached signature is expected to be armored. If the key ring does not contain the concerning public key then the key is downloaded from a pool server and added to the existing key ring. A non-nil error is returned, if signature verification was unsuccessful.

Types

type FullReader

type FullReader struct {
	Base io.ReadCloser
}

FullReader is an io.ReadCloser whose Read() implementation always fills the read buffer as much as possible by calling Base.Read() repeatedly.

func (*FullReader) Close

func (r *FullReader) Close() error

Close implements the io.Reader interface.

func (*FullReader) Read

func (r *FullReader) Read(buf []byte) (int, error)

Read implements the io.Reader interface.

type GPGKeyRing

type GPGKeyRing struct {
	EntityList openpgp.EntityList
	Mux        sync.RWMutex
}

GPGKeyRing contains a list of openpgp Entities. It is used to verify different types of GPG signatures.

Jump to

Keyboard shortcuts

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