Documentation ¶
Overview ¶
Package web provides a webserver which allows for: viewing of results; administration of submissions, projects and tools; user management;
Index ¶
- Constants
- Variables
- func Active() bool
- func AddProject(r *http.Request, c *context.C) (string, error)
- func AddSkeleton(r *http.Request, c *context.C) (string, error)
- func BaseTemplates() []string
- func CheckAccess(p string, c *context.C, ps map[string]user.Permission) error
- func CreateCheckstyle(r *http.Request, c *context.C) (string, error)
- func CreateFindbugs(r *http.Request, c *context.C) (string, error)
- func CreateJPF(r *http.Request, c *context.C) (string, error)
- func CreateJUnit(r *http.Request, c *context.C) (string, error)
- func CreateMake(r *http.Request, c *context.C) (string, error)
- func CreatePMD(r *http.Request, c *context.C) (string, error)
- func DeleteProjects(r *http.Request, c *context.C) (string, error)
- func DeleteResults(r *http.Request, c *context.C) (string, error)
- func DeleteSkeletons(r *http.Request, c *context.C) (string, error)
- func DeleteSubmissions(r *http.Request, c *context.C) (string, error)
- func DeleteUsers(r *http.Request, c *context.C) (string, error)
- func Downloaders() map[string]Downloader
- func EditFile(r *http.Request, c *context.C) (string, error)
- func EditProject(r *http.Request, c *context.C) (string, error)
- func EditSubmission(r *http.Request, c *context.C) (string, error)
- func EditTest(r *http.Request, c *context.C) (string, error)
- func EditUser(r *http.Request, c *context.C) (string, error)
- func ExportData(r *http.Request) (string, error)
- func FileHandler(origin string) http.Handler
- func GenerateAJAX(r *pat.Router)
- func GenerateDownloads(r *pat.Router, d map[string]Downloader)
- func GenerateGets(r *pat.Router, gets map[string]Getter, views map[string]string)
- func GeneratePosts(router *pat.Router, posts map[string]Poster, indexPosts map[string]bool)
- func GenerateViews(r *pat.Router, views map[string]string)
- func GetResult(r *context.Result, fileId bson.ObjectId) (result.Displayer, error)
- func Getters() map[string]Getter
- func ImportData(r *http.Request, c *context.C) (string, error)
- func IndexPosters() map[string]bool
- func LoadIntlola(r *http.Request) (string, error)
- func LoadSkeleton(r *http.Request) (string, error)
- func LoadTest(r *http.Request) (string, error)
- func Login(r *http.Request, c *context.C) (string, error)
- func Logout(r *http.Request, c *context.C) (string, error)
- func Permissions() map[string]user.Permission
- func Posters() map[string]Poster
- func RedirectHandler(dest string) http.Handler
- func Register(r *http.Request, c *context.C) (string, error)
- func RenameFiles(r *http.Request, c *context.C) (string, error)
- func Run(port uint)
- func RunTools(r *http.Request, c *context.C) (string, error)
- func StaticDir() string
- func SubmitArchive(r *http.Request, c *context.C) (string, error)
- func T(names ...string) *template.Template
- func TemplateDir() string
- func Views() map[string]string
- type AJAXGet
- type AJAXPost
- type Args
- type Downloader
- type Getter
- type Handler
- type Poster
- type Select
- type Selects
Constants ¶
const ( LOG_SERVER = "webserver/server.go" PORT uint = 8080 )
const (
LOG_HANDLERS = "webserver/handlers.go"
)
const (
OUT user.Permission = 42
)
Variables ¶
var ( CountsError = errors.New("unsupported counts request") CommentsError = errors.New("unsupported comments request") ResultsError = errors.New("cannot retrieve results") )
var (
InvalidArgsError = errors.New("invalid args call")
)
var (
JPFKeyError = errors.New("JPF key cannot be empty")
)
Functions ¶
func AddProject ¶
AddProject creates a new Impendulo Project.
func BaseTemplates ¶
func BaseTemplates() []string
BaseTemplates loads the base HTML templates used by all views in the web app.
func CheckAccess ¶
CheckAccess verifies that a user is allowed access to a url.
func CreateCheckstyle ¶
CreateCheckstyle
func CreateFindbugs ¶
CreateFindbugs
func CreateJPF ¶
CreateJPF replaces a project's JPF configuration with a new, provided configuration.
func CreateJUnit ¶
CreateJUnit adds a new JUnit test for a given project.
func DeleteProjects ¶
DeleteProjects removes a project and all data associated with it from the system.
func DeleteResults ¶
DeleteResults removes all results for a specic project.
func DeleteUsers ¶
DeleteUsers removes users and all data associated with them from the system.
func Downloaders ¶
func Downloaders() map[string]Downloader
func EditProject ¶
EditProject is used to modify a project's metadata.
func EditSubmission ¶
EditSubmission
func FileHandler ¶
func GenerateAJAX ¶
func GenerateDownloads ¶
func GenerateDownloads(r *pat.Router, d map[string]Downloader)
GenerateDownloads
func GenerateGets ¶
GenerateGets loads post request handlers and adds them to the router.
func GeneratePosts ¶
GeneratePosts loads post request handlers and adds them to the router.
func GenerateViews ¶
GenerateViews is used to load all the basic views used by our web app.
func IndexPosters ¶
indexPosters loads the posters which need to be redirected to the home page on success.
func LoadSkeleton ¶
LoadSkeleton makes a project skeleton available for download.
func RedirectHandler ¶
func RunTools ¶
RunTools runs a tool on submissions in a given project. Previous results are deleted if the user has specified that the tool should be rerun on all files.
func StaticDir ¶
func StaticDir() string
StaticDir retrieves the directory containing all the static files for the web server.
func SubmitArchive ¶
SubmitArchive adds an Intlola archive to the database.
func TemplateDir ¶
func TemplateDir() string
TemplateDir retrieves the directory in which HTML templates are stored.
Types ¶
type Args ¶
type Args map[string]interface{}
Args represents arguments passed to html templates or to template.Execute.
type Downloader ¶
type Handler ¶
Handler is used to handle incoming requests. It allows for better session management.
type Poster ¶
A function used to fullfill a POST request.
func (Poster) CreatePost ¶
CreatePost loads a post request handler.