Documentation
¶
Index ¶
Constants ¶
const Type = "auth"
Variables ¶
This section is empty.
Functions ¶
func CliFlags ¶
CliFlags will be used by Vulcand construct help and CLI command for the vctl command
func FromCli ¶
func FromCli(c *cli.Context) (plugin.Middleware, error)
FromCli constructs the middleware from the command line
func FromOther ¶
func FromOther(c AuthMiddleware) (plugin.Middleware, error)
FromOther Will be called by Vulcand when engine or API will read the middleware from the serialized format. It's important that the signature of the function will be exactly the same, otherwise Vulcand will fail to register this middleware. The first and the only parameter should be the struct itself, no pointers and other variables. Function should return middleware interface and error in case if the parameters are wrong.
func GetSpec ¶
func GetSpec() *plugin.MiddlewareSpec
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
Auth middleware handler
func (*AuthHandler) ServeHTTP ¶
func (a *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
This function will be called each time the request hits the location with this middleware activated
type AuthMiddleware ¶
AuthMiiddleware struct holds configuration parameters and is used to serialize/deserialize the configuration from storage engines.
func New ¶
func New(user, pass string) (*AuthMiddleware, error)
This function is optional but handy, used to check input parameters when creating new middlewares
func (*AuthMiddleware) NewHandler ¶
This function is important, it's called by vulcand to create a new handler from the middleware config and put it into the middleware chain. Note that we need to remember 'next' handler to call
func (*AuthMiddleware) String ¶
func (c *AuthMiddleware) String() string
String() will be called by loggers inside Vulcand and command line tool.