server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package server provides the back-end implementation of the kjudge app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotFoundHandler

func NotFoundHandler(c echo.Context) error

NotFoundHandler handles the "not found" situation. It should be a catch-all for all urls.

func StaticFiles

func StaticFiles(c echo.Context) error

StaticFiles serves files from the source fileb0x. It filters away files that don't end with ".css", ".js" or ".map"

Types

type Server

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

Server this the root entry of the server.

func New

func New(db *db.DB) (*Server, error)

New creates a new server.

func (*Server) HandleError

func (s *Server) HandleError(err error, c echo.Context)

HandleError defines an error handler that complies with echo's standards.

func (*Server) SetupProfiling

func (s *Server) SetupProfiling()

SetupProfiling sets up profiling for the server in development mode.

func (*Server) Start

func (s *Server) Start(port int) error

Start starts the server, listening for requests.

func (*Server) StartWithTLS

func (s *Server) StartWithTLS(address string) error

StartWithTLS starts the server, also tries to get a cert from LetsEncrypt.

Directories

Path Synopsis
Package admin defines admin routes.
Package admin defines admin routes.
Package auth implements the authentication functions for the server.
Package auth implements the authentication functions for the server.
Package httperr provides some convenience functions to create echo HTTP errors.
Package httperr provides some convenience functions to create echo HTTP errors.
User implements a group that handle /user requests.
User implements a group that handle /user requests.

Jump to

Keyboard shortcuts

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