auth

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AvailableMethods Returns a map of available auth methods
	AvailableMethods = map[string]Method{
		"none":  new(noAuth),
		"basic": new(basicAuth),
	}
)

Functions

This section is empty.

Types

type Method

type Method interface {
	// Called after ParseParam method.
	// auth.Method should initialize itself here and get ready to receive requests.
	// Logger has been initialized so it is safe to call logger methods here.
	Init(debug bool)
	// Return Method Usage Info
	Usage() string
	// Parse the parameter passed through the -authparam flag
	// Logger is not initialized at this state so do NOT call logger methods
	// If the parameter is unacceptable, return an error and main should exit
	ParseParam(string) error
	// Return a middleware to handle connections.
	Middleware() func(http.Handler) http.Handler
}

Method an interface describing an authentication method

Jump to

Keyboard shortcuts

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