From 777761a8a1be2a8eef9f360ddede7d4dbc7684d2 Mon Sep 17 00:00:00 2001 From: Doug Black Date: Sat, 25 Jan 2014 14:38:03 -0800 Subject: update README --- tests/items.go | 29 +++++++++++++++++++++++++++++ tests/test.go | 6 ------ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 tests/items.go (limited to 'tests') 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) + +} diff --git a/tests/test.go b/tests/test.go index 53c7f9e..4610f3d 100644 --- a/tests/test.go +++ b/tests/test.go @@ -15,12 +15,6 @@ func (b Bar) Get(values ...url.Values) (int, interface{}) { return 200, map[string]string{"hello": "goodbye"} } -type Baz struct { - sleepy.PostNotSupported - sleepy.PutNotSupported - sleepy.DeleteNotSupported -} - func main() { bar := new(Bar) -- cgit