handlers

package
v0.11.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebsocket added in v0.11.0

func NewWebsocket(handler WebSocketHandler, w http.ResponseWriter, r *http.Request)

func ReadFromRequest added in v0.11.0

func ReadFromRequest(request *http.Request, v interface{}) error

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"`
}

type WebSocketHandler added in v0.11.0

type WebSocketHandler func() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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