lostisland/go-sawyer — pull request #16 by technoweenie (2014-01-16 04:10:24+00:00)
Title: Functional rels

This takes a more functional approach to getting hypermedia relations out of an object. Check the test changes to see how this affects things. It should fix the bug with automatically trying to merge the relations of a `[]Collection` into the Response object.

Looking up cached relations could be done with something like (not implemented yet):

```go
hypermedia.Rels(hypermedia.Cache("/users/1", &User{}))
```

The `hypermedia.Cache` object (not really happy with the name) knows how to check the cache for the relations on the User object. If it's not cached, make the request, decode it into the given `*User`, and return its Relations.

Thoughts?