handlers

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteErrorResponse

func WriteErrorResponse(response http.ResponseWriter, message string, code int)

func WriteResponse

func WriteResponse(response http.ResponseWriter, bytes []byte)

Types

type AdminHandler

type AdminHandler interface {
	RegisterRoutes(*bone.Mux, *AuthHandler)
}

type AllUsersResponse

type AllUsersResponse struct {
	Users []backends.User `json:"users"`
}

type AuthHandler

type AuthHandler struct {
	AB                 backends.Authentication
	SecretKey          []byte
	JWTExpirationDelta int
	Enabled            bool
}

func (*AuthHandler) GetAllUsersHandler

func (a *AuthHandler) GetAllUsersHandler(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

GetAllUsersHandler - returns a list of all users

func (*AuthHandler) Login

func (a *AuthHandler) Login(w http.ResponseWriter, r *http.Request)

func (*AuthHandler) Logout

func (a *AuthHandler) Logout(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

func (*AuthHandler) RefreshToken

func (a *AuthHandler) RefreshToken(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

func (*AuthHandler) RegisterRoutes

func (this *AuthHandler) RegisterRoutes(mux *bone.Mux)

func (*AuthHandler) RequireTokenAuthentication

func (a *AuthHandler) RequireTokenAuthentication(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)

type ErrorView

type ErrorView struct {
	Error string `json:"error"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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