Documentation ¶
Index ¶
- func APIHandlerFunc(rp RequestProcessFunc) http.HandlerFunc
- func Login(oAuth *service.OAuth) http.HandlerFunc
- type Export
- type RequestProcessFunc
- func CreateExperiment(repo *repository.Experiments) RequestProcessFunc
- func GetAssignmentsForUserExperiment(repo *repository.Assignments) RequestProcessFunc
- func GetExperimentDetails(repo *repository.Experiments, assignmentsRepo *repository.Assignments) RequestProcessFunc
- func GetExperiments(repo *repository.Experiments, assignmentsRepo *repository.Assignments) RequestProcessFunc
- func GetFeatures(filePairRepo *repository.FilePairs, featuresRepo *repository.Features) RequestProcessFunc
- func GetFilePairAnnotations(repo *repository.Assignments) RequestProcessFunc
- func GetFilePairDetails(repo *repository.FilePairs, diff *service.Diff) RequestProcessFunc
- func GetFilePairs(repo *repository.FilePairs) RequestProcessFunc
- func Me(usersRepo *repository.Users) RequestProcessFunc
- func OAuthCallback(oAuth *service.OAuth, jwt *service.JWT, userRepo *repository.Users, ...) RequestProcessFunc
- func SaveAssignment(repo *repository.Assignments) RequestProcessFunc
- func UpdateExperiment(repo *repository.Experiments, assignmentsRepo *repository.Assignments) RequestProcessFunc
- func UploadFilePairs(db *dbutil.DB) RequestProcessFunc
- func Version(version string) RequestProcessFunc
- type Static
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIHandlerFunc ¶ added in v0.0.4
func APIHandlerFunc(rp RequestProcessFunc) http.HandlerFunc
APIHandlerFunc returns an http.HandlerFunc that will serve the user request taking the serializer.Response and errors from the passed RequestProcessFunc
Types ¶
type Export ¶
type Export struct {
// contains filtered or unexported fields
}
Export contains handlers for file export
func (*Export) Create ¶
Create creates new export file and returns a *serializer.Response with the name of new file
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 CreateExperiment ¶ added in v0.0.4
func CreateExperiment(repo *repository.Experiments) RequestProcessFunc
CreateExperiment returns a function that saves the experiment as passed in the body request
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, assignmentsRepo *repository.Assignments) RequestProcessFunc
GetExperimentDetails returns a function that returns a *serializer.Response with the details of a requested experiment
func GetExperiments ¶ added in v0.0.2
func GetExperiments(repo *repository.Experiments, assignmentsRepo *repository.Assignments) RequestProcessFunc
GetExperiments returns a function that returns a *serializer.Response with the list of existing experiments
func GetFeatures ¶
func GetFeatures(filePairRepo *repository.FilePairs, featuresRepo *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, diff *service.Diff) 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 OAuthCallback ¶
func OAuthCallback( oAuth *service.OAuth, jwt *service.JWT, userRepo *repository.Users, logger logrus.FieldLogger, ) RequestProcessFunc
OAuthCallback makes exchange with oauth provider, gets&creates user and redirects to index page with JWT token
func SaveAssignment ¶
func SaveAssignment(repo *repository.Assignments) RequestProcessFunc
SaveAssignment returns a function that saves the user answers as passed in the body request
func UpdateExperiment ¶ added in v0.0.4
func UpdateExperiment(repo *repository.Experiments, assignmentsRepo *repository.Assignments) RequestProcessFunc
UpdateExperiment returns a function that updates the experiment as passed in the body request
func UploadFilePairs ¶ added in v0.0.4
func UploadFilePairs(db *dbutil.DB) RequestProcessFunc
UploadFilePairs returns a function that imports file pair from import db file to the experiment
func Version ¶ added in v0.0.1
func Version(version string) RequestProcessFunc
Version returns a function that returns a *serializer.Response with a current version of server
type Static ¶ added in v0.0.1
type Static struct {
// contains filtered or unexported fields
}
Static contains handlers to serve static using go-bindata
func (*Static) ServeHTTP ¶ added in v0.0.1
func (s *Static) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves any static file from static directory or fallbacks on index.hml
func (*Static) ServeIndexHTML ¶ added in v0.0.1
func (s *Static) ServeIndexHTML(initialState interface{}) http.HandlerFunc
ServeIndexHTML serves index.html file with initial state