func One() martini.Handler { return func(r render.Render, params martini.Params) { bucket, err := db.FindByName(params["name"]) if err != nil { comm.JsonErr(r, err) } else { comm.JsonContent(r, bucket) } } }
func Save() martini.Handler { return func(data db.Bucket, r render.Render) { err := DB.Save(&data).Error if err != nil { comm.JsonErr(r, err) } else { initBuckets() comm.JsonContent(r, &data) } } }
func List() martini.Handler { return func(r render.Render) { comm.JsonContent(r, Buckets()) } }
func NameList() martini.Handler { return func(r render.Render) { comm.JsonContent(r, Names()) } }