Documentation ¶
Index ¶
- Variables
- func App() *buffalo.App
- func CommentGetHandler(c buffalo.Context) error
- func CommentPostHandler(c buffalo.Context) error
- func CreateSlide(surveyID string, email string) error
- func DashboardGetHandler(c buffalo.Context) error
- func DownloadHandler(c buffalo.Context) error
- func GetFiles(c buffalo.Context) error
- func GetIpsativeData(c buffalo.Context) error
- func GetIpsativeSurveys(c buffalo.Context) error
- func GetLikertQuestions(c buffalo.Context) error
- func GetLikertSurveys(c buffalo.Context) error
- func GetState(c buffalo.Context) error
- func HealthzHandler(c buffalo.Context) error
- func JwtMiddleware(next buffalo.Handler) buffalo.Handler
- func RegistrationHandler(c buffalo.Context) error
- func SaveSurveyResults(results []SurveyResult, surveyID uuid.UUID, c buffalo.Context) (string, error)
- func SurveysHandler(c buffalo.Context) error
- func UpdateState(c buffalo.Context) error
- func UploadHandler(c buffalo.Context) error
- type DashboardData
- type IpsativeResponse
- type RegistrationStruct
- type ResultsStruct
- type SurveyResult
- type Token
Constants ¶
This section is empty.
Variables ¶
var ENV = envy.Get("GO_ENV", "development")
ENV is used to help switch settings based on where the application is being run. Default is "development".
var ISS = envy.Get("HAVEN_JWT_ISS", "")
ISS needs to match your deployment. The JWT issuer field is filled out by keycloak based on the hostname that the authentication request comes in on.
var KEY = envy.Get("HAVEN_JWK_PATH", "")
KEY gets the haven jwk path
Functions ¶
func App ¶
App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.
func CommentGetHandler ¶
CommentGetHandler accepts a comment get request
func CommentPostHandler ¶
CommentPostHandler accepts a comment post
func CreateSlide ¶
CreateSlide triggers a worker job to create a report with R
func DashboardGetHandler ¶
DashboardGetHandler returns all goodies for the dashboard the path GET /api/dashboard
func DownloadHandler ¶
DownloadHandler downloads a report
func GetFiles ¶
GetFiles returns all files available for the user the path GET /api/files/{fileType[zip,pptx]}
func GetIpsativeData ¶
GetIpsativeData returns ipsative data the path GET /api/ipsative_data/{surveyID}
func GetIpsativeSurveys ¶
GetIpsativeSurveys returns all ipsative surveys the path GET /api/ipsative_surveys
func GetLikertQuestions ¶
GetLikertQuestions returns all likert questions the path GET /api/likert_questions
func GetLikertSurveys ¶
GetLikertSurveys returns all likert surveys the path GET /api/likert_surveys
func GetState ¶
GetState gets the data for one user. This function is mapped to the path GET /api/state
func HealthzHandler ¶
HealthzHandler checks for a working DB connection
func JwtMiddleware ¶
JwtMiddleware validates JWT and set context compatible with PostgREST
func RegistrationHandler ¶
RegistrationHandler accepts json
func SaveSurveyResults ¶
func SaveSurveyResults(results []SurveyResult, surveyID uuid.UUID, c buffalo.Context) (string, error)
SaveSurveyResults creates a survey_response and saves all responses
func UpdateState ¶
UpdateState updates the state for a user. This function is mapped to the path POST /api/state
func UploadHandler ¶
UploadHandler accepts a file upload
Types ¶
type DashboardData ¶
type DashboardData struct { Slide models.FileInfo `json:"slide"` Zip models.FileInfo `json:"zip"` LastSurveyResponse models.SurveyResponse `json:"last_survey_response"` }
DashboardData is a struct of what data we want on the dashboard
type IpsativeResponse ¶
type IpsativeResponse struct { UUID uuid.UUID `json:"uuid" db:"uuid"` AnswerID string `json:"answer_id" db:"answer_id"` Category string `json:"category" db:"-"` GroupNumber int `json:"group_number" db:"group_number"` PointsAssigned int `json:"points_assigned" db:"points_assigned"` CreatedAt time.Time `json:"created_at" db:"created_at"` UserID uuid.UUID `json:"user_id" db:"user_id"` SurveyResponseID uuid.UUID `json:"survey_response_id" db:"survey_response_id"` UserEmail string `json:"user_email" db:"user_email"` }
IpsativeResponse is a data type for the entered response
type RegistrationStruct ¶
type RegistrationStruct struct { Email string `json:"email"` Results []ResultsStruct `json:"survey_results"` SurveyID uuid.UUID `json:"survey_id"` }
RegistrationStruct is a struct for the funnel
type ResultsStruct ¶
type ResultsStruct struct { ID string `json:"answer_id"` Group int `json:"group_number"` Points int `json:"points_assigned"` }
ResultsStruct is a struct for the funnel