handlers

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 23 Imported by: 0

README

handlers

import "github.com/coralproject/shelf/cmd/askd/handlers"

Overview

Package handlers contains the handler logic for processing requests.

Index

Package files

aggregations.go csv_handler.go form.go form_gallery.go form_submission.go version.go

Variables

var Aggregation aggregationHandle

Aggregation fronts the access to the form service functionality.

var ErrInvalidCaptcha = errors.New("captcha invalid")

ErrInvalidCaptcha is returned when a captcha is required for a form but it is not valid on the request.

var Form formHandle

Form fronts the access to the form service functionality.

var FormGallery formGalleryHandle

FormGallery fronts the access to the form service functionality.

var FormSubmission formSubmissionHandle

FormSubmission fronts the access to the form service functionality.

var Version verHandle

Version fronts the access to the ver service functionality.

func ValidateReacaptchaResponse

func ValidateReacaptchaResponse(c *web.Context, recaptchaSecret, response string) error

ValidateReacaptchaResponse will compare the response provided by the request and check with the Google Recaptcha Web Service if it's valid.

type AggregationKeys

type AggregationKeys struct {
    Aggregations map[string]form.Aggregation `json:"aggregations"`
}

AggregationKeys is a transport type that describes the json format for return value of the aggregate endpoint including a key lookup structure allowing consumers to easily find group keys.

type FormDigest

type FormDigest struct {
    Questions map[string]FormQuestionDigest `json:"questions" bson:"questions"`
}

FormDigest is the blueprint for how we send form digests to clients.

type FormQuestionDigest

type FormQuestionDigest struct {
    ID      string                     `json:"id" bson:"id"`
    Type    string                     `json:"type" bson:"type"`
    Title   string                     `json:"title" bson:"title"`
    GroupBy bool                       `json:"group_by" bson:"group_by"`
    Options []FormQuestionOptionDigest `json:"options,omitempty" bson:"options,omitempty"`
    Order   int                        `json:"order" bson:"order"`
}

FormQuestionDigest is the bluprint for a question in a form group.

type FormQuestionOptionDigest

type FormQuestionOptionDigest struct {
    ID    string `json:"id" bson:"id"`
    Value string `json:"value" bson:"value"`
}

FormQuestionOptionDigest is the blueprint for a single multiple choice option.


Generated by godoc2md

Documentation

Overview

Package handlers contains the handler logic for processing requests.

Index

Constants

This section is empty.

Variables

View Source
var Aggregation aggregationHandle

Aggregation fronts the access to the form service functionality.

View Source
var ErrInvalidCaptcha = errors.New("captcha invalid")

ErrInvalidCaptcha is returned when a captcha is required for a form but it is not valid on the request.

View Source
var Form formHandle

Form fronts the access to the form service functionality.

View Source
var FormGallery formGalleryHandle

FormGallery fronts the access to the form service functionality.

View Source
var FormSubmission formSubmissionHandle

FormSubmission fronts the access to the form service functionality.

View Source
var Version verHandle

Version fronts the access to the ver service functionality.

Functions

func ValidateReacaptchaResponse added in v0.4.3

func ValidateReacaptchaResponse(c *web.Context, recaptchaSecret, response string) error

ValidateReacaptchaResponse will compare the response provided by the request and check with the Google Recaptcha Web Service if it's valid.

Types

type AggregationKeys added in v0.4.4

type AggregationKeys struct {
	Aggregations map[string]form.Aggregation `json:"aggregations"`
}

AggregationKeys is a transport type that describes the json format for return value of the aggregate endpoint including a key lookup structure allowing consumers to easily find group keys.

type FormDigest added in v0.4.4

type FormDigest struct {
	Questions map[string]FormQuestionDigest `json:"questions" bson:"questions"`
}

FormDigest is the blueprint for how we send form digests to clients.

type FormQuestionDigest added in v0.4.4

type FormQuestionDigest struct {
	ID      string                     `json:"id" bson:"id"`
	Type    string                     `json:"type" bson:"type"`
	Title   string                     `json:"title" bson:"title"`
	GroupBy bool                       `json:"group_by" bson:"group_by"`
	Options []FormQuestionOptionDigest `json:"options,omitempty" bson:"options,omitempty"`
	Order   int                        `json:"order" bson:"order"`
}

FormQuestionDigest is the bluprint for a question in a form group.

type FormQuestionOptionDigest added in v0.4.4

type FormQuestionOptionDigest struct {
	ID    string `json:"id" bson:"id"`
	Value string `json:"value" bson:"value"`
}

FormQuestionOptionDigest is the blueprint for a single multiple choice option.

Jump to

Keyboard shortcuts

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