aboutsummaryrefslogtreecommitdiff
path: root/tests/items.go
diff options
context:
space:
mode:
authorDoug Black <dougblack@gatech.edu>2014-01-25 14:38:03 -0800
committerDoug Black <dougblack@gatech.edu>2014-01-25 14:38:03 -0800
commit777761a8a1be2a8eef9f360ddede7d4dbc7684d2 (patch)
tree0b710b48240d8ef0559c532e1329be2631aee096 /tests/items.go
parentbetter practices (diff)
downloadsleepy-777761a8a1be2a8eef9f360ddede7d4dbc7684d2.tar.gz
sleepy-777761a8a1be2a8eef9f360ddede7d4dbc7684d2.tar.bz2
sleepy-777761a8a1be2a8eef9f360ddede7d4dbc7684d2.zip
update README
Diffstat (limited to 'tests/items.go')
-rw-r--r--tests/items.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/items.go b/tests/items.go
new file mode 100644
index 0000000..a6f53f6
--- /dev/null
+++ b/tests/items.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "net/url"
+ "sleepy"
+)
+
+type Item struct {
+ sleepy.PostNotSupported
+ sleepy.PutNotSupported
+ sleepy.DeleteNotSupported
+}
+
+func (item Item) Get(values ...url.Values) (int, interface{}) {
+ items := []string{"item1", "item2"}
+ data := map[string][]string{"items": items}
+
+ return 200, data
+}
+
+func main() {
+
+ item := new(Item)
+
+ var api = new(sleepy.Api)
+ api.AddResource(item, "/items")
+ api.Start(3000)
+
+}
bgstack15