people

package
v0.0.0-...-a6c8cb9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func MakeController

func MakeController(services services.Services) Controller

MakeController is a factory that creates a people controller

func (Controller) Create

func (c Controller) Create(req *restful.Request, resp *restful.Response,
	form forms.PersonForm)

Create creates a new person using the data from the HTTP form displayed by a previous NEW request.

func (Controller) Delete

func (c Controller) Delete(req *restful.Request, resp *restful.Response)

Delete reponds to a DELETE request and deletes the record with the given ID, eg DELETE http://server:port/people/1.

func (Controller) Edit

func (c Controller) Edit(req *restful.Request, resp *restful.Response,
	form forms.PersonForm)

Edit fetches the data for the people record with the given ID and displays the edit page, populated with that data.

func (Controller) ErrorHandler

func (c Controller) ErrorHandler(req *restful.Request, resp *restful.Response,
	errormessage string)

ErrorHandler displays the index page with an error message

func (Controller) Index

func (c Controller) Index(req *restful.Request, resp *restful.Response,
	form forms.ListForm)

Index fetches a list of all valid people and displays the index page.

func (Controller) New

func (c Controller) New(req *restful.Request, resp *restful.Response,
	form forms.PersonForm)

New displays the page to create a new person,

func (*Controller) SetServices

func (c *Controller) SetServices(services services.Services)

SetServices sets the services.

func (Controller) Show

func (c Controller) Show(req *restful.Request, resp *restful.Response,
	form forms.PersonForm)

Show displays the details of the person with the ID given in the URI.

func (Controller) Update

func (c Controller) Update(req *restful.Request, resp *restful.Response,
	form forms.PersonForm)

Update responds to a PUT request. For example: PUT /people/1 It's invoked by the form displayed by a previous Edit request. If the ID in the URI is valid and the request parameters from the form specify valid people data, it updates the record and displays the index page with a confirmation message, otherwise it displays the edit page again with the given data and some error messages.

Jump to

Keyboard shortcuts

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