handlers

package
v0.0.0-...-8717a1f Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceErrorsHTTPMapping = map[error]struct {
		HTTPCode int
		ErrCode  string
	}{
		userland.ErrUserNotFound: {
			HTTPCode: http.StatusNotFound,
			ErrCode:  "ErrUserNotFound",
		},
		authentication.ErrUserRegistered: {
			HTTPCode: http.StatusBadRequest,
			ErrCode:  "ErrUserRegistered",
		},
		authentication.ErrWrongOTP: {
			HTTPCode: http.StatusBadRequest,
			ErrCode:  "ErrWrongOTP",
		},
		authentication.ErrWrongPassword: {
			HTTPCode: http.StatusBadRequest,
			ErrCode:  "ErrWrongPassword",
		},
		authentication.ErrUserNotVerified: {
			HTTPCode: http.StatusBadRequest,
			ErrCode:  "ErrUserNotVerified",
		},
		authentication.ErrOTPInvalid: {
			HTTPCode: http.StatusBadRequest,
			ErrCode:  "ErrOTPInvalid",
		},
		profile.ErrWrongOTP: {
			HTTPCode: http.StatusNotFound,
			ErrCode:  "ErrWrongOTP",
		},
		profile.ErrWrongPassword: {
			HTTPCode: http.StatusNotFound,
			ErrCode:  "ErrWrongPassword",
		},
		profile.ErrEmailAlreadyUsed: {
			HTTPCode: http.StatusNotFound,
			ErrCode:  "ErrEmailAlreadyUsed",
		},
	}
)

Functions

This section is empty.

Types

type AuthenticationHandler

type AuthenticationHandler struct {
	Authenticator         middlewares.Middleware
	RateLimiter           middlewares.MiddlewareWithArgs
	Authorization         middlewares.MiddlewareWithArgs
	AuthenticationService authentication.Service
	SessionService        session.Service
	ProfileService        profile.Service
	EventService          event.Service
}

func (AuthenticationHandler) RegisterRoutes

func (h AuthenticationHandler) RegisterRoutes(router *mux.Router)

type HealthzHandler

type HealthzHandler struct{}

func (HealthzHandler) RegisterRoutes

func (h HealthzHandler) RegisterRoutes(router *mux.Router)

type MetricHandler

type MetricHandler struct{}

func (MetricHandler) RegisterRoutes

func (h MetricHandler) RegisterRoutes(router *mux.Router)

type ProfileHandler

type ProfileHandler struct {
	Authorization  middlewares.MiddlewareWithArgs
	Authenticator  middlewares.Middleware
	RateLimiter    middlewares.MiddlewareWithArgs
	ProfileService profile.Service
	EventService   event.Service
}

func (ProfileHandler) RegisterRoutes

func (h ProfileHandler) RegisterRoutes(router *mux.Router)

type SessionHandler

type SessionHandler struct {
	Authorization  middlewares.MiddlewareWithArgs
	Authenticator  middlewares.Middleware
	SessionService session.Service
	ProfileService profile.Service
}

func (SessionHandler) RegisterRoutes

func (h SessionHandler) RegisterRoutes(router *mux.Router)

Jump to

Keyboard shortcuts

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