Documentation ¶
Index ¶
- func IsDir(f http.File) bool
- func NewRouter(dbConnection *sqlx.DB, redisClient *redis.Client, jobServer *machinery.Server, ...) (chi.Router, error)
- type AuthTokenResponseData
- type AuthenticationMiddleware
- type AvatarUploadResponseData
- type ClientLog
- type ClientLogs
- type ConfirmUserRequestData
- type FrontendHandler
- type InstallRequestData
- type LoginRequestData
- type LoginResponseData
- type LogoutResponseData
- type NewUserAccount
- type PublicSettingsResponse
- type RegisterUserRequestData
- type RegisteredUserResponseData
- type Setup
- type TaskcafeHandler
- func (h *TaskcafeHandler) ConfirmUser(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) Frontend(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) HandleClientLog(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) LoginHandler(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) ProfileImageUpload(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) PublicSettings(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) RegisterUser(w http.ResponseWriter, r *http.Request)
- func (h *TaskcafeHandler) ValidateAuthTokenHandler(w http.ResponseWriter, r *http.Request)
- type ValidateAuthTokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthTokenResponseData ¶
type AuthTokenResponseData struct {
AccessToken string `json:"accessToken"`
}
AuthTokenResponseData is the response data for when an access token is refreshed
type AuthenticationMiddleware ¶
type AuthenticationMiddleware struct {
// contains filtered or unexported fields
}
AuthenticationMiddleware is a middleware that requires a valid JWT token to be passed via the Authorization header
func (*AuthenticationMiddleware) Middleware ¶
func (m *AuthenticationMiddleware) Middleware(next http.Handler) http.Handler
Middleware returns the middleware handler
type AvatarUploadResponseData ¶
AvatarUploadResponseData is the response data for a user profile is uploaded
type ClientLogs ¶
type ClientLogs struct {
Logs []ClientLog `json:"logs"`
}
type ConfirmUserRequestData ¶
type ConfirmUserRequestData struct {
ConfirmToken string
}
ConfirmUserRequestData is the request data for upgrading an invited user to a normal user
type FrontendHandler ¶
type FrontendHandler struct {
// contains filtered or unexported fields
}
FrontendHandler serves an embed React client through chi
func (FrontendHandler) ServeHTTP ¶
func (h FrontendHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP attempts to serve a requested file for the embedded React client
type InstallRequestData ¶
type InstallRequestData struct {
User NewUserAccount
}
InstallRequestData is the request data for installing new Taskcafe app
type LoginRequestData ¶
LoginRequestData is the request data when a user logs in
type LoginResponseData ¶
LoginResponseData is the response data for when a user logs in
type LogoutResponseData ¶
type LogoutResponseData struct {
Status string `json:"status"`
}
LogoutResponseData is the response data for when a user logs out
type NewUserAccount ¶
type NewUserAccount struct { FullName string `json:"fullname"` Username string Password string Initials string Email string }
NewUserAccount is the request data for a new user
type PublicSettingsResponse ¶
type RegisterUserRequestData ¶
type RegisterUserRequestData struct {
User NewUserAccount
}
RegisterUserRequestData is the request data for registering a new user (duh)
type RegisteredUserResponseData ¶
type RegisteredUserResponseData struct {
Setup bool `json:"setup"`
}
type TaskcafeHandler ¶
type TaskcafeHandler struct { AppConfig config.AppConfig // contains filtered or unexported fields }
TaskcafeHandler contains all the route handlers
func (*TaskcafeHandler) ConfirmUser ¶
func (h *TaskcafeHandler) ConfirmUser(w http.ResponseWriter, r *http.Request)
func (*TaskcafeHandler) Frontend ¶
func (h *TaskcafeHandler) Frontend(w http.ResponseWriter, r *http.Request)
Frontend serves the index.html file
func (*TaskcafeHandler) HandleClientLog ¶
func (h *TaskcafeHandler) HandleClientLog(w http.ResponseWriter, r *http.Request)
func (*TaskcafeHandler) LoginHandler ¶
func (h *TaskcafeHandler) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler creates a new refresh & access token for the user if given the correct credentials
func (*TaskcafeHandler) LogoutHandler ¶
func (h *TaskcafeHandler) LogoutHandler(w http.ResponseWriter, r *http.Request)
LogoutHandler removes all refresh tokens to log out user
func (*TaskcafeHandler) ProfileImageUpload ¶
func (h *TaskcafeHandler) ProfileImageUpload(w http.ResponseWriter, r *http.Request)
ProfileImageUpload handles a user uploading a new avatar profile image
func (*TaskcafeHandler) PublicSettings ¶
func (h *TaskcafeHandler) PublicSettings(w http.ResponseWriter, r *http.Request)
func (*TaskcafeHandler) RegisterUser ¶
func (h *TaskcafeHandler) RegisterUser(w http.ResponseWriter, r *http.Request)
func (*TaskcafeHandler) ValidateAuthTokenHandler ¶
func (h *TaskcafeHandler) ValidateAuthTokenHandler(w http.ResponseWriter, r *http.Request)