func (res *Resource) Get(storage store.Get) {
	res.HandleFunc(
		pat.Get(patID),
		func(w http.ResponseWriter, r *http.Request) {
			res.getHandler(w, r, storage)
		},
	)
	res.addRoute(get, patID)
}
Get registers a `GET /resource/:id` handler for the resource
package jshapi
import (
	"fmt"
	"net/http"
	"path"
	"reflect"
	"strings"
	"goji.io"
	"goji.io/pat"
	"github.com/derekdowling/go-json-spec-handler"
	"github.com/derekdowling/go-json-spec-handler/jsh-api/store"
)
const (
	post    = "POST"
	get     = "GET"
	list    = "LIST"
	delete  = "DELETE"
	patch   = "PATCH"
	patID   = "/:id"
	patRoot = ""
)
type Resource struct {
	*goji.Mux
	Type string
	Routes []string
	Relationships map[string]Relationship
}
func NewResource(resourceType string) *Resource {
	return &Resource{
		Mux: goji.SubMux(),
		Type:          resourceType,
		Relationships: map[string]Relationship{},
		Routes: []string{},
	}
}
func NewCRUDResource(resourceType string, storage store.CRUD) *Resource {
	resource := NewResource(resourceType)
	resource.CRUD(storage)
	return resource
}
func (res *Resource) CRUD(storage store.CRUD) {
	res.Get(storage.Get)
	res.Patch(storage.Update)
	res.Post(storage.Save)
	res.List(storage.List)
	res.Delete(storage.Delete)
}
func (res *Resource) Post(storage store.Save) {
	res.HandleFunc(
		pat.Post(patRoot),
		func(w http.ResponseWriter, r *http.Request) {
			res.postHandler(w, r, storage)
		},
	)
	res.addRoute(post, patRoot)
}