handler

package
v0.0.0-...-25f5927 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2015 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicResponse

func BasicResponse(code int) func(response http.ResponseWriter, request *http.Request)

BasicResponse creates a handler which responds with a standard response code and message string.

func NewTask

func NewTask(response http.ResponseWriter, request *http.Request)

NewTask handles requests to the /tasks/new endpoint.

func Task

func Task(response http.ResponseWriter, request *http.Request)

Task handles requests to the /tasks/{id} endpoint.

func Tasks

func Tasks(response http.ResponseWriter, request *http.Request)

Tasks handles requests to the /tasks endpoint.

func WriteBasicResponse

func WriteBasicResponse(code int, response http.ResponseWriter)

WriteBasicResponse responds the the request with a BasicResponse

func WriteJSONResponse

func WriteJSONResponse(response http.ResponseWriter, message interface{}, statusCode int)

WriteJSONResponse writes a json response (with correct http header).

Types

type NewTaskParams

type NewTaskParams struct {
	Name       string   `json:"name"`
	ParentIDs  []string `json:"parentIDs"`
	DueDate    int64    `json:"dueDate"`
	Categories []string `json:"categories"`
}

NewTaskParams is the json struct that gets passed in the request to create a new Task object.

type UpdateTaskParams

type UpdateTaskParams struct {
	Name       string   `json:"name"`
	Complete   bool     `json:"complete"`
	SubtaskIDs []string `json:"subtaskIDs"`
	ParentIDs  []string `json:"parentIDs"`
	DueDate    int64    `json:"dueDate"`
	Categories []string `json:"categories"`
}

UpdateTaskParams is the json struct that gets passed in the request to update a Task object.

Jump to

Keyboard shortcuts

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