api

package
v0.0.0-...-5733806 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 New

func New(base *sudoapi.BaseAPI) *API

New declares a new API instance

func (*API) Handler

func (s *API) Handler() http.Handler

Handler is the magic behind the API

func (*API) MustBeAdmin

func (s *API) MustBeAdmin(next http.Handler) http.Handler

MustBeAdmin is middleware to make sure the user creating the request is an admin

func (*API) MustBeAuthed

func (s *API) MustBeAuthed(next http.Handler) http.Handler

MustBeAuthed is middleware to make sure the user creating the request is authenticated

func (*API) MustBeProposer

func (s *API) MustBeProposer(next http.Handler) http.Handler

MustBeProposer is middleware to make sure the user creating the request is a proposer

func (*API) MustBeVisitor

func (s *API) MustBeVisitor(next http.Handler) http.Handler

MustBeVisitor is middleware to make sure the user creating the request is not authenticated

func (*API) SetupSession

func (s *API) SetupSession(next http.Handler) http.Handler

SetupSession adds the user with the specified user ID to context

type Assets

type Assets struct {
	// contains filtered or unexported fields
}

func NewAssets

func NewAssets(base *sudoapi.BaseAPI) *Assets

func (*Assets) AssetsRouter

func (s *Assets) AssetsRouter() http.Handler

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(w http.ResponseWriter, r *http.Request)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL