func (t *TodoResource) Identifier() string {
	return "id"
}
Identifier returns the identifying property.
package main
import (
	"fmt"
	"strconv"
	"github.com/twharmon/goweb"
)
type Todo struct {
	Text string
}
type TodoResource struct {
	Todos   map[string]Todo
	counter int
}
func New() *TodoResource {
	return &TodoResource{
		Todos:   make(map[string]Todo),
		counter: 0,
	}
}
func (t *TodoResource) Index(c *goweb.Context) goweb.Responder {
	fmt.Println(t.Todos)
	return c.JSON(t.Todos)
}
func (t *TodoResource) Get(c *goweb.Context) goweb.Responder {
	id := c.Param(t.Identifier())
	return c.JSON(t.Todos[id])
}
func (t *TodoResource) Put(c *goweb.Context) goweb.Responder {
	id := c.Param(t.Identifier())
	t.Todos[id] = Todo{"put called"}
	return c.JSON(t.Todos[id])
}
func (t *TodoResource) Delete(c *goweb.Context) goweb.Responder {
	delete(t.Todos, c.Param(t.Identifier()))
	return c.JSON(len(t.Todos))
}
func (t *TodoResource) Post(c *goweb.Context) goweb.Responder {
	id := t.counter
	t.counter++
	t.Todos[strconv.Itoa(id)] = Todo{Text: "new from post"}
	return c.JSON(id)
}