handler

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FrontendStatics

func FrontendStatics(staticsPath string, useIndexFallback bool) http.HandlerFunc

FrontendStatics handles the static-files requests, serving the files under the given staticsPath if useIndexFallback is set to true and the requested file does not exist, the staticsPath/index.html will be served

func Get

Get returns an http.HandlerFunc that will serve the user request taking the serializer.Response and errors from the passed RequestProcessFunc

func Login

func Login(oAuth *service.OAuth) http.HandlerFunc

Login handler redirects user to oauth provider

func OAuthCallback

func OAuthCallback(
	oAuth *service.OAuth,
	jwt *service.JWT,
	userRepo *repository.Users,
	uiDomain string,
	logger logrus.FieldLogger,
) http.HandlerFunc

OAuthCallback makes exchange with oauth provider, gets&creates user and redirects to index page with JWT token

Types

type Export

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

Export contains handlers for file export

func NewExport

func NewExport(db *dbutil.DB, exportsPath string) *Export

NewExport creates new Export

func (*Export) Create

func (h *Export) Create(r *http.Request) (*serializer.Response, error)

Create creates new export file and returns a *serializer.Response with the name of new file

func (*Export) Download

func (h *Export) Download(w http.ResponseWriter, r *http.Request)

Download writes requested file to response

func (*Export) List

func (h *Export) List(r *http.Request) (*serializer.Response, error)

List returns a *serializer.Response with a list of files for export

type RequestProcessFunc

type RequestProcessFunc func(*http.Request) (*serializer.Response, error)

RequestProcessFunc is a function that takes an http.Request, and returns a serializer.Response and an error

func GetAssignmentsForUserExperiment

func GetAssignmentsForUserExperiment(repo *repository.Assignments) RequestProcessFunc

GetAssignmentsForUserExperiment returns a function that returns a *serializer.Response with the assignments for the logged user and a passed experiment if these assignments do not already exist, they are created in advance

func GetExperimentDetails

func GetExperimentDetails(repo *repository.Experiments) RequestProcessFunc

GetExperimentDetails returns a function that returns a *serializer.Response with the details of a requested experiment

func GetFeatures

func GetFeatures(repo *repository.Features) RequestProcessFunc

GetFeatures returns a function that returns a *serializer.Response with the list of features for blobId

func GetFilePairAnnotations

func GetFilePairAnnotations(repo *repository.Assignments) RequestProcessFunc

GetFilePairAnnotations returns a function that returns a *serializer.Response with the Annotation results for the given File Pair and Experiment IDs

func GetFilePairDetails

func GetFilePairDetails(repo *repository.FilePairs) RequestProcessFunc

GetFilePairDetails returns a function that returns a *serializer.Response with the details of the requested FilePair

func GetFilePairs

func GetFilePairs(repo *repository.FilePairs) RequestProcessFunc

GetFilePairs returns a function that returns a *serializer.Response with the list of file pairs for the given experiment ID

func Me

func Me(usersRepo *repository.Users) RequestProcessFunc

Me handler returns a function that returns a *serializer.Response with the information about the current user

func SaveAssignment

func SaveAssignment(repo *repository.Assignments) RequestProcessFunc

SaveAssignment returns a function that saves the user answers as passed in the body request

Jump to

Keyboard shortcuts

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