middleware

package
v0.0.0-...-3b732ea Latest Latest
Warning

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

Go to latest
Published: May 15, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

Auth provides the middleware to authenticate against the registered API key.

func NewAuth

func NewAuth(apiKey string, apiKeyParamName string) *Auth

NewAuth instantiates our middleware object.

func (*Auth) ServeHTTP

func (a *Auth) ServeHTTP(w http.ResponseWriter, r *http.Request, ps httprouter.Params, next http.HandlerFunc)

ServeHTTP deals with authenticating against the registered API key. The API key is expected to be in the query string where one is provided.

Jump to

Keyboard shortcuts

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