Documentation ¶
Index ¶
- Variables
- type API
- func (s *API) Handler() http.Handler
- 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) MustBeVisitor(next http.Handler) http.Handler
- func (s *API) SetupSession(next http.Handler) http.Handler
- type Assets
- func (s *Assets) AssetsRouter() http.Handler
- func (s *Assets) ServeAttachment(w http.ResponseWriter, r *http.Request)
- func (s *Assets) ServeContestLeaderboard(w http.ResponseWriter, r *http.Request)
- func (s *Assets) ServeProblemArchive() http.HandlerFunc
- func (s *Assets) ServeSubtest(w http.ResponseWriter, r *http.Request)
- func (s *Assets) ServeTestInput(w http.ResponseWriter, r *http.Request)
- func (s *Assets) ServeTestOutput(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
View Source
var FilterUserAgent = config.GenFlag[bool]("behavior.user_agent_filter", true, "Filter user agent in API (block python requests from non-admins)")
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the base struct for the project's API
func (*API) MustBeAdmin ¶
MustBeAdmin is middleware to make sure the user creating the request is an admin
func (*API) MustBeAuthed ¶
MustBeAuthed is middleware to make sure the user creating the request is authenticated
func (*API) MustBeProposer ¶
MustBeProposer is middleware to make sure the user creating the request is a proposer
func (*API) MustBeVisitor ¶
MustBeVisitor is middleware to make sure the user creating the request is not authenticated
type Assets ¶
type Assets struct {
// contains filtered or unexported fields
}
func (*Assets) AssetsRouter ¶
func (*Assets) ServeAttachment ¶
func (s *Assets) ServeAttachment(w http.ResponseWriter, r *http.Request)
func (*Assets) ServeContestLeaderboard ¶
func (s *Assets) ServeContestLeaderboard(w http.ResponseWriter, r *http.Request)
func (*Assets) ServeProblemArchive ¶
func (s *Assets) ServeProblemArchive() http.HandlerFunc
func (*Assets) ServeSubtest ¶
func (s *Assets) ServeSubtest(w http.ResponseWriter, r *http.Request)
func (*Assets) ServeTestInput ¶
func (s *Assets) ServeTestInput(w http.ResponseWriter, r *http.Request)
func (*Assets) ServeTestOutput ¶
func (s *Assets) ServeTestOutput(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.