Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple resource types #18

Open
celrenheit opened this issue Nov 15, 2016 · 0 comments
Open

Multiple resource types #18

celrenheit opened this issue Nov 15, 2016 · 0 comments

Comments

@celrenheit
Copy link
Owner

Currently there is only one form of resources (RESTful).
This is a small proposal to extend resource to multiple type.

RESTful

router.Resource("/users", myResource)
HTTP method Path Struct's method name
GET /users Get
Head /users Head
POST /users Post
PUT /users Put
PATCH /users Patch
DELETE /users Delete
CONNECT /users Connect

Resourceful

router.Resource("/users", myResource)
HTTP method Path Struct's method name
GET /users Index
POST /users Create
GET /users/:id Show
PUT or PATCH /users/:id Update
DELETE /users/:id Destroy

Hopefully this could be customized.
I currently have not decided the best way to specify differents types.
The resource could implement an interface or by embedding a type.

Feedback are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant