utils

package
v0.0.0-...-9f65fc3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyChanToWriter

func CopyChanToWriter(closeChan <-chan interface{}, inChan <-chan []byte, fd io.Writer, errChan chan<- error)

func CopyReaderToChan

func CopyReaderToChan(closeChan <-chan interface{}, fd io.Reader, outChan chan<- []byte, errChan chan<- error)

outChan should have len == 1, so writing to it blocks, there is no buffering and the buffer isn't overwritten

func EnsureAuth

func EnsureAuth(resp *http.Response, auth *url.Userinfo, body io.Reader) (outResp *http.Response, err error)

Types

type DigestHeaders

type DigestHeaders struct {
	Realm     string
	Qop       string
	Method    string
	Nonce     string
	Opaque    string
	Algorithm string
	HA1       string
	HA2       string
	Cnonce    string
	Path      string
	Nc        int16
	Username  string
	Password  string
}

DigestHeaders tracks the state of authentication

func (*DigestHeaders) ApplyAuth

func (d *DigestHeaders) ApplyAuth(req *http.Request)

ApplyAuth adds proper auth header to the passed request

Jump to

Keyboard shortcuts

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