httphelpers

package
v0.2.50 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBasicAuthHeader

func AddBasicAuthHeader(r *http.Request, user string, pass string)

func BasicAuthHeaderVal

func BasicAuthHeaderVal(user string, pass string) string

func CreateFormFile

func CreateFormFile(fieldname string, paths []string, flags []FlagValues) (io.Reader, string, error)

func CreateFormRequest

func CreateFormRequest(url string, fieldname string, filepaths []string) (*http.Request, error)

func CreateFormRequestFlags

func CreateFormRequestFlags(url string, fieldname string, filepaths []string, flags []FlagValues) (*http.Request, error)

Types

type AuthFilter

type AuthFilter interface {
	Filter(handler http.Handler) http.Handler
	CheckAuth(req *http.Request) bool
}

func NewAuthFilter

func NewAuthFilter(adminUsername string, adminPassword string) AuthFilter

type FlagValues

type FlagValues struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

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