controllers

package
v0.0.0-...-f6db44e Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*revel.Controller
}

func (App) Endpoint

func (c App) Endpoint() revel.Result

func (App) Index

func (c App) Index() revel.Result

type ById

type ById []Item
var ItemList ById = make([]Item, 0, 1)

func (ById) Find

func (list ById) Find(id int) (Item, int)

Find an item from the list with Id `id` and the index -1 for not found

func (ById) Len

func (list ById) Len() int

func (ById) Less

func (list ById) Less(i, j int) bool

func (ById) Search

func (list ById) Search(id int) int

Search for an item by id and return the index

func (ById) Swap

func (list ById) Swap(i, j int)

type Item

type Item struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type Items

type Items struct {
	*revel.Controller
}

func (Items) Create

func (c Items) Create() revel.Result

Create an item

func (Items) Delete

func (c Items) Delete(id int) revel.Result

Delete an item

func (Items) List

func (c Items) List() revel.Result

List the current set of items

func (Items) Read

func (c Items) Read(id int) revel.Result

Read an item

func (Items) Update

func (c Items) Update(id int, name string) revel.Result

Update an item

Jump to

Keyboard shortcuts

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