handlers

package
v0.0.0-...-f20c94d Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2016 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureAuthHandler

func ConfigureAuthHandler(router *mux.Router, interactor UserInteractor, session *sessions.CookieStore)

ConfigureAuthHandler configures router routes for authentication

func ConfigureKeysRouter

func ConfigureKeysRouter(router *mux.Router, interactor KeyInteractor, session *sessions.CookieStore)

ConfigureKeysRouter configures router routes for key management

func ConfigureStaticRouter

func ConfigureStaticRouter(router *mux.Router)

ConfigureStaticRouter is used for publishing static directory to internet

Types

type KeyInteractor

type KeyInteractor interface {
	AddKey(key *domain.Key) error
	GetKeys() []domain.Key
	GetUserKeys(user string) []domain.Key
	DeleteKey(id int64) error
}

KeyInteractor interface

type KeyServiceHandler

type KeyServiceHandler struct {
	utils.HttpUtils
	KeyInteractor KeyInteractor
	Session       *sessions.CookieStore
}

KeyServiceHandler struct

func (KeyServiceHandler) AuthMiddleware

func (handler KeyServiceHandler) AuthMiddleware(rw http.ResponseWriter, q *http.Request, next http.HandlerFunc)

AuthMiddleware function contained on KeyServiceHandler

type UserInteractor

type UserInteractor interface {
	AddUser(user *domain.User) error
	AuthenticateUser(username, password string) (domain.User, error)
}

UserInteractor interface

type UserServiceHandler

type UserServiceHandler struct {
	utils.HttpUtils
	UserInteractor UserInteractor
	Session        *sessions.CookieStore
}

UserServiceHandler struct

Jump to

Keyboard shortcuts

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