Documentation ¶
Index ¶
- func BadRequestResponse(w http.ResponseWriter, error string)
- func ErrorResponse(w http.ResponseWriter, error string, code int)
- func MethodNotAllowedResponse(w http.ResponseWriter, error string)
- func NotFoundResponse(w http.ResponseWriter, error string)
- func ServerErrorResponse(w http.ResponseWriter, error string)
- func UnprocessableEntityResponse(w http.ResponseWriter, error string)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequestResponse ¶
func BadRequestResponse(w http.ResponseWriter, error string)
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, error string, code int)
ErrorResponse responds with and logs the given error message to the console, alongside the given response code. Any error messages will be rendered inside the #error element of the page.
func MethodNotAllowedResponse ¶
func MethodNotAllowedResponse(w http.ResponseWriter, error string)
func NotFoundResponse ¶
func NotFoundResponse(w http.ResponseWriter, error string)
func ServerErrorResponse ¶
func ServerErrorResponse(w http.ResponseWriter, error string)
func UnprocessableEntityResponse ¶
func UnprocessableEntityResponse(w http.ResponseWriter, error string)
Types ¶
type Server ¶
type Server struct { // Addr is the address for the Server to listen on. Addr string // Templates holds all the templates used by the application. Templates map[string]*template.Template // Services used by the various HTTP routes. EntrantService tournament.EntrantService PlayerService tournament.PlayerService TierService tournament.TierService TournamentService tournament.TournamentService // contains filtered or unexported fields }
Server provides several HTTP handlers for servicing tournament-related requests.
func NewServer ¶
NewServer creates a Server with the given credentials. The other fields should be applied manually.
func (*Server) ListenAndServe ¶
Click to show internal directories.
Click to hide internal directories.