Documentation ¶
Index ¶
- func ConfigureAuthHandler(router *mux.Router, interactor UserInteractor, session *sessions.CookieStore)
- func ConfigureKeysRouter(router *mux.Router, interactor KeyInteractor, session *sessions.CookieStore)
- func ConfigureStaticRouter(router *mux.Router)
- type KeyInteractor
- type KeyServiceHandler
- type UserInteractor
- type UserServiceHandler
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 ¶
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
Click to show internal directories.
Click to hide internal directories.