handlers

package
v0.0.0-...-adfe93d Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRequestBody

func DecodeRequestBody(r *http.Request, model interface{}) error

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, message string)

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})

func ValidateContentType

func ValidateContentType(next http.Handler) http.Handler

Types

type AccountID

type AccountID int
const TokenAccountID AccountID = 0

type CustomClaims

type CustomClaims struct {
	AccountID int    `json:"account_id"`
	CSRFToken string `json:"csrf_token"`
	jwt.StandardClaims
}

type HandlerEnv

type HandlerEnv struct {
	DB         *db.DB
	Production bool
}

func (*HandlerEnv) CreateAllSettingsHandler

func (he *HandlerEnv) CreateAllSettingsHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) CreateCORSHandler

func (he *HandlerEnv) CreateCORSHandler() *cors.Cors

func (*HandlerEnv) CreateEventHandler

func (he *HandlerEnv) CreateEventHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) CreateTaskHandler

func (he *HandlerEnv) CreateTaskHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) DeleteEventHandler

func (he *HandlerEnv) DeleteEventHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) DeleteTaskHandler

func (he *HandlerEnv) DeleteTaskHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetEventHandler

func (he *HandlerEnv) GetEventHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetEventsByTaskIdHandler

func (he *HandlerEnv) GetEventsByTaskIdHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetEventsHandler

func (he *HandlerEnv) GetEventsHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetEventsInIntervalHandler

func (he *HandlerEnv) GetEventsInIntervalHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetSettingValueHandler

func (he *HandlerEnv) GetSettingValueHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetSettingsHandler

func (he *HandlerEnv) GetSettingsHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetTaskHandler

func (he *HandlerEnv) GetTaskHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) GetTasksHandler

func (he *HandlerEnv) GetTasksHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) IndexHandler

func (he *HandlerEnv) IndexHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) LoginHandler

func (he *HandlerEnv) LoginHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) LogoutHandler

func (he *HandlerEnv) LogoutHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) RegisterHandler

func (he *HandlerEnv) RegisterHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) SetCookie

func (he *HandlerEnv) SetCookie(w http.ResponseWriter, name, value string)

func (*HandlerEnv) SetHttpOnlyCookie

func (he *HandlerEnv) SetHttpOnlyCookie(w http.ResponseWriter, name, value string)

func (*HandlerEnv) UpdateEventHandler

func (he *HandlerEnv) UpdateEventHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) UpdateSettingValueHandler

func (he *HandlerEnv) UpdateSettingValueHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) UpdateTaskHandler

func (he *HandlerEnv) UpdateTaskHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) ValidateHandler

func (he *HandlerEnv) ValidateHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerEnv) VerifyTokenMiddleware

func (he *HandlerEnv) VerifyTokenMiddleware(next http.Handler) http.Handler

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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