Documentation ¶
Index ¶
- Constants
- type API
- func (s *API) CreateProblem(w http.ResponseWriter, r *http.Request)
- func (s *API) CreateSubmission(w http.ResponseWriter, r *http.Request)
- func (s *API) CreateTest(w http.ResponseWriter, r *http.Request)
- func (s *API) DeleteByName(w http.ResponseWriter, r *http.Request)
- func (s *API) DeleteTestById(w http.ResponseWriter, r *http.Request)
- func (s *API) GetAllTests(w http.ResponseWriter, r *http.Request)
- func (s *API) GetAllUsers(w http.ResponseWriter, r *http.Request)
- func (s *API) GetProblemByName(w http.ResponseWriter, r *http.Request)
- func (s *API) GetProblemTests(w http.ResponseWriter, r *http.Request)
- func (s *API) GetProblems(w http.ResponseWriter, r *http.Request)
- func (s *API) GetSubmissionById(w http.ResponseWriter, r *http.Request)
- func (s *API) GetSubmissionTestById(w http.ResponseWriter, r *http.Request)
- func (s *API) GetSubmissionTests(w http.ResponseWriter, r *http.Request)
- func (s *API) GetSubmissions(w http.ResponseWriter, r *http.Request)
- func (s *API) GetTestById(w http.ResponseWriter, r *http.Request)
- func (s *API) GetUserByUserName(w http.ResponseWriter, r *http.Request)
- func (s *API) GetUserGravatar(w http.ResponseWriter, r *http.Request)
- func (s *API) Login(w http.ResponseWriter, r *http.Request)
- func (s *API) Logout(w http.ResponseWriter, r *http.Request)
- func (s *API) MustBeAdmin(next http.Handler) http.Handler
- func (s *API) MustBeAuthed(next http.Handler) http.Handler
- func (s *API) MustBeProposer(next http.Handler) http.Handler
- func (s *API) MustNotBeAuthed(next http.Handler) http.Handler
- func (s *API) ProblemCtx(next http.Handler) http.Handler
- func (s *API) Routes() http.Handler
- func (s *API) Signup(w http.ResponseWriter, r *http.Request)
- func (s *API) SubmissionCtx(next http.Handler) http.Handler
- func (s *API) SubmissionTestCtx(next http.Handler) http.Handler
- func (s *API) TestCtx(next http.Handler) http.Handler
- func (s *API) UpdateProblemByName(w http.ResponseWriter, r *http.Request)
- func (s *API) UpdateTestById(w http.ResponseWriter, r *http.Request)
- func (s *API) UserCtx(next http.Handler) http.Handler
- type UserGravatarResponse
Constants ¶
const ( HttpOnlyCookieAuthKey = "auth-token-http-only" CookieAuthKey = "auth-token" CookieUserKey = "user" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) CreateProblem ¶
func (s *API) CreateProblem(w http.ResponseWriter, r *http.Request)
CreateProblem is the handler behind POST /api/problems/
func (*API) CreateSubmission ¶
func (s *API) CreateSubmission(w http.ResponseWriter, r *http.Request)
CreateSubmission is the handler behind POST /api/submissions/
func (*API) CreateTest ¶
func (s *API) CreateTest(w http.ResponseWriter, r *http.Request)
CreateTest is the handler behind POST /api/tests/
func (*API) DeleteByName ¶
func (s *API) DeleteByName(w http.ResponseWriter, r *http.Request)
CreateProblem is the handler behind DELETE /api/problems/{problemName}
func (*API) DeleteTestById ¶
func (s *API) DeleteTestById(w http.ResponseWriter, r *http.Request)
DeleteTestById is the handler behind DELETE /api/tests/{testId}
func (*API) GetAllTests ¶
func (s *API) GetAllTests(w http.ResponseWriter, r *http.Request)
CreateTest is the handler behind GET /api/tests/
func (*API) GetAllUsers ¶
func (s *API) GetAllUsers(w http.ResponseWriter, r *http.Request)
GetUserByUserName is the handler behind GET /api/users/
func (*API) GetProblemByName ¶
func (s *API) GetProblemByName(w http.ResponseWriter, r *http.Request)
GetProblemByName is the handler behind GET /api/problems/{problemName}
func (*API) GetProblemTests ¶
func (s *API) GetProblemTests(w http.ResponseWriter, r *http.Request)
GetProblemTests is the handler behind GET /api/tests/{problemName} Returns all the tests for the specified problem
func (*API) GetProblems ¶
func (s *API) GetProblems(w http.ResponseWriter, r *http.Request)
GetProblems is the handler behind GET /api/problems/ URL parameters could be sent for data filtering ex. GET /api/problems?authorId=1&difficulty=easy params available: authorId(int), Difficulty(string), credits(string), stream(string)
func (*API) GetSubmissionById ¶
func (s *API) GetSubmissionById(w http.ResponseWriter, r *http.Request)
GetSubmissions is the handler behind GET /api/submissions/{submissionId}
func (*API) GetSubmissionTestById ¶
func (s *API) GetSubmissionTestById(w http.ResponseWriter, r *http.Request)
func (*API) GetSubmissionTests ¶
func (s *API) GetSubmissionTests(w http.ResponseWriter, r *http.Request)
GET /api/submission-tests/{submissionId}
func (*API) GetSubmissions ¶
func (s *API) GetSubmissions(w http.ResponseWriter, r *http.Request)
GetSubmissions is the handler behind GET /api/submissions/ URL parameters could be sent for data filtering ex. GET /api/submissions?lang=go&score=100 params available: userId(int), problemId(int), score(int), lang(string), status(string), compileError(boolean)
func (*API) GetTestById ¶
func (s *API) GetTestById(w http.ResponseWriter, r *http.Request)
GetTestById is the handler behind GET /api/tests/{testId}
func (*API) GetUserByUserName ¶
func (s *API) GetUserByUserName(w http.ResponseWriter, r *http.Request)
GetUserByUserName is the handler behind GET /api/users/{username}
func (*API) GetUserGravatar ¶
func (s *API) GetUserGravatar(w http.ResponseWriter, r *http.Request)
func (*API) Login ¶
func (s *API) Login(w http.ResponseWriter, r *http.Request)
Login is the handler behind POST /api/auth/login.
func (*API) MustBeAdmin ¶
MustBeAdmin is a middleware that makes sure that the user creating the request is an admin.
func (*API) MustBeAuthed ¶
MustBeAuthed is a middleware that makes sure that the user creating the request is authenticated.
func (*API) MustBeProposer ¶
MustBeProposer is a middleware that makes sure that the user creating the request is a proposer.
func (*API) MustNotBeAuthed ¶
MustNotBeAuthed is a middleware that makes sure that the user creating the request is not authenticated.
func (*API) ProblemCtx ¶
ProblemCtx middleware is used to attach the problem from the URL parameters to the request context.
func (*API) Signup ¶
func (s *API) Signup(w http.ResponseWriter, r *http.Request)
Signup is the handler behind POST /api/auth/signup.
func (*API) SubmissionCtx ¶
SubmissionCtx middleware is used to attach the file-managers from the URL parameters to the request context.
func (*API) TestCtx ¶
TestCtx middleware is used to attach the test from the URL parameters to the request context.
func (*API) UpdateProblemByName ¶
func (s *API) UpdateProblemByName(w http.ResponseWriter, r *http.Request)
CreateProblem is the handler behind PUT /api/problems/{problemName}
func (*API) UpdateTestById ¶
func (s *API) UpdateTestById(w http.ResponseWriter, r *http.Request)
UpdateTestById is the handler behind PUT /api/tests/