Documentation ¶
Index ¶
- Variables
- type Server
- func (s *Server) GetAnswersLog(w http.ResponseWriter, r *http.Request, userID uuid.UUID, ...)
- func (s *Server) GetNextQuestion(w http.ResponseWriter, r *http.Request, params oapi.GetNextQuestionParams)
- func (s *Server) GetRemainingTopics(w http.ResponseWriter, r *http.Request)
- func (s *Server) HealthCheck(w http.ResponseWriter, r *http.Request)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) Start() error
- func (s *Server) SubmitAnswer(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the REST server that handles external requests (e.g. from browsers).
func (*Server) GetAnswersLog ¶
func (s *Server) GetAnswersLog( w http.ResponseWriter, r *http.Request, userID uuid.UUID, params oapi.GetAnswersLogParams, )
GetAnswersLog returns a list of previous attempts at answering questions from the specified user.
func (*Server) GetNextQuestion ¶
func (s *Server) GetNextQuestion( w http.ResponseWriter, r *http.Request, params oapi.GetNextQuestionParams, )
GetNextQuestion returns the next question that a user should answer for the specified topic.
func (*Server) GetRemainingTopics ¶
func (s *Server) GetRemainingTopics(w http.ResponseWriter, r *http.Request)
GetRemainingTopics returns the list of topics with questions still unanswered by the user making the request. Each of these topics comes with the actual amount of questions left to answer.
func (*Server) HealthCheck ¶
func (s *Server) HealthCheck(w http.ResponseWriter, r *http.Request)
HealthCheck returns a 204 status code if the server is healthy, and a 503 status code otherwise.
func (*Server) SubmitAnswer ¶
func (s *Server) SubmitAnswer(w http.ResponseWriter, r *http.Request)
SubmitAnswer registers the choice made by a user for a specific question, and returns the correct choice for it, plus some more info for the user to know how they did.
Directories ¶
Path | Synopsis |
---|---|
Package oapi provides primitives to interact with the openapi HTTP API.
|
Package oapi provides primitives to interact with the openapi HTTP API. |