httpauth

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("403 Forbidden")

Functions

func IsForbidden

func IsForbidden(err error) bool

IsForbidden tests whether the passed-in error wraps errForbidden.

Types

type Client

type Client interface {
	Get(path string) ([]byte, error)
}

Client defines an http REST client. Currently only GET is supported.

func NewClient

func NewClient(httpClient *http.Client, tok string) Client

type FakeHandler

type FakeHandler struct {
	Reqs []*http.Request
}

FakeHandler implements http.Handler, and handles fake requests for testing, appending requests to an array member for later inspection

func (*FakeHandler) ServeHTTP

func (h *FakeHandler) ServeHTTP(_ http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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