Skip to content

Commit b893b94

Browse files
philippecarlewwwdata
authored andcommitted
Split CRUD interface (#286)
1 parent dc368bb commit b893b94

File tree

6 files changed

+378
-82
lines changed

6 files changed

+378
-82
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ If you need api2go with any different go framework, just send a PR with the acco
372372

373373
## Building a REST API
374374

375-
First, write an implementation of `api2go.CRUD`. You have to implement at least these 4 methods:
375+
First, write an implementation of either `api2go.ResourceGetter`, `api2go.ResourceCreator`, `api2go.ResourceUpdater`, `api2go.ResourceDeleter`, or any combination of them.
376+
You can also write an implementation the `CRUD` interface which embed all of them.
377+
You have to implement at least one of these 4 methods:
376378

377379
```go
378380
type fixtureSource struct {}
@@ -469,7 +471,7 @@ type EditToManyRelations interface {
469471

470472
All PATCH, POST and DELETE routes do a `FindOne` and update the values/relations in the previously found struct. This
471473
struct will then be passed on to the `Update` method of a resource struct. So you get all these routes "for free" and just
472-
have to implement the CRUD Update method.
474+
have to implement the `ResourceUpdater` `Update` method.
473475

474476
### Query Params
475477
To support all the features mentioned in the `Fetching Resources` section of Jsonapi:

0 commit comments

Comments
 (0)