Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Base resource struct #37

Closed
wants to merge 3 commits into from
Closed

Base resource struct #37

wants to merge 3 commits into from

Conversation

technoweenie
Copy link
Contributor

Add's a base Resource type to Root and PullRequest.

}
return r.rels
return r.Resource.RelsOf(r)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to not have to implement this on every type. But the *Resource has no knowledge of the actual API resource, so it can't access the hypermedia fields.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have a solution to this. What we are trying to do is to fill the hypermedia.Relations map either from the GitHub xxx_url convention or from the HAL convention link convention. Instead of overriding Rels(), we could inject hypermedia.Relations after the http call. We could use reflection to inject the relations map. I'll create a PR to further demonstrate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That probably works better. No reason this has to be a function on the type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #39

@pengwynn
Copy link
Collaborator

pengwynn commented May 3, 2015

Gonna close this as it looks stale. Please re-open if I'm mistaken.

@pengwynn pengwynn closed this May 3, 2015
@pengwynn pengwynn deleted the base-resource-struct branch May 3, 2015 00:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants