controllers

package
v0.0.0-...-5805fc1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2015 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvitationTemplatePath string
View Source
var SubTemplatePath string

Functions

func Certificate

func Certificate(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

Certificate will return all public certificates assigned by App Engine in PEM format.

func ChallengeByKey

func ChallengeByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

ChallengeByKey loads a challenge by key.

func CollectTokens

func CollectTokens(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

CollectTokens runs a query against Datastore to find expired Tokens and deletes them.

func CreateChallenge

func CreateChallenge(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

CreateChallenge will put a new entity of kind Challenge to Datastore.

func CreateResult

func CreateResult(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

CreateResult saves a new result when a coder starts a challenge.

func DeleteProfile

func DeleteProfile(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func FinalSubmission

func FinalSubmission(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

FinalSubmission makes the last submission final.

func GetChallengesForCompany

func GetChallengesForCompany(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

GetChallengesForCompany queries all the challenges defined by a company.

func GetChallengesForProfile

func GetChallengesForProfile(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetCompanyByUser

func GetCompanyByUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func GetProfileByKey

func GetProfileByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func GetProfileForUser

func GetProfileForUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetResult

func GetResult(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func GetResultForUserChallenge

func GetResultForUserChallenge(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func GetResultsByChallenge

func GetResultsByChallenge(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

GetResultsByChallenge queries the results for a certain challenge to be reviewed by a company.

func GetSubmissionByKey

func GetSubmissionByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetSubmissionsForResult

func GetSubmissionsForResult(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetTestResultsForSubmission

func GetTestResultsForSubmission(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetUser

func GetUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func GetUsersByCompany

func GetUsersByCompany(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

GetUsersByCompany queries the user accounts belonging to a company.

func Handler

func Handler() http.Handler

func Invitation

func Invitation(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

Invitation handles the creation of a new invitation and sends an e-mail to the user.

func Mock

func Mock(w http.ResponseWriter, req *http.Request)

func MockFrequentisChallenge

func MockFrequentisChallenge(ctx context.Context, company *datastore.Key, w http.ResponseWriter, req *http.Request)

func PostCompany

func PostCompany(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

PostCompany creates a new company after validating by key.

func PostSubmission

func PostSubmission(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

PostSubmission creates a new submission.

func ReceiveMail

func ReceiveMail(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

ReceiveMail will receive an e-mail and echo it back to the sender.

func Status

func Status(w http.ResponseWriter, r *http.Request)

Status gathers a quick overview of the system state and dumps it in JSON format.

func Subscriptions

func Subscriptions(w http.ResponseWriter, r *http.Request)

func TaskByKey

func TaskByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

TaskByKey loads a task by key.

func Tasks

func Tasks(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func Templates

func Templates(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

func TestsByTaskKey

func TestsByTaskKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func Tokens

func Tokens(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

Tokens will create new Tokens for the user.

func User

func User(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error)

func WhoAmI

func WhoAmI(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)

Types

type ContextHandlerFunc

type ContextHandlerFunc func(context.Context, http.ResponseWriter, *http.Request) (int, error)

ContextHandlerFunc is similar to a http.HandlerFunc, but also gets passed the current context. To ease error handling, a ContextHandleFunc must return a HTTP status code and an error. Still, the handler is allowed to write a response.

func (ContextHandlerFunc) ServeHTTP

func (h ContextHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Subscription

type Subscription struct {
	Address          mail.Address
	EntryTime        time.Time
	Token            []byte
	VerificationTime time.Time
}

func (Subscription) RequestConfirmation

func (sub Subscription) RequestConfirmation(ctx context.Context) error

Jump to

Keyboard shortcuts

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