@@ -13,7 +13,7 @@ A serializer/deserializer for JSON payloads that comply to the
13
13
## Installation
14
14
15
15
```
16
- go get -u github.com/moltin /jsonapi
16
+ go get -u github.com/elasticpath /jsonapi
17
17
```
18
18
19
19
Or, see [ Alternative Installation] ( #alternative-installation ) .
@@ -77,7 +77,7 @@ all of your data easily.
77
77
78
78
## Example App
79
79
80
- [ examples/app.go] ( https://github.com/moltin /jsonapi/blob/master/examples/app.go )
80
+ [ examples/app.go] ( https://github.com/elasticpath /jsonapi/blob/master/examples/app.go )
81
81
82
82
This program demonstrates the implementation of a create, a show,
83
83
and a list [ http.Handler] ( http://golang.org/pkg/net/http#Handler ) . It
@@ -91,9 +91,9 @@ To run,
91
91
* Make sure you have [ Go installed] ( https://golang.org/doc/install )
92
92
* Create the following directories or similar: ` ~/go `
93
93
* Set ` GOPATH ` to ` PWD ` in your shell session, ` export GOPATH=$PWD `
94
- * ` go get github.com/moltin /jsonapi ` . (Append ` -u ` after ` get ` if you
94
+ * ` go get github.com/elasticpath /jsonapi ` . (Append ` -u ` after ` get ` if you
95
95
are updating.)
96
- * ` cd $GOPATH/src/github.com/moltin /jsonapi/examples `
96
+ * ` cd $GOPATH/src/github.com/elasticpath /jsonapi/examples `
97
97
* ` go build && ./examples `
98
98
99
99
## ` jsonapi ` Tag Reference
@@ -198,7 +198,7 @@ about the rest?
198
198
### Create Record Example
199
199
200
200
You can Unmarshal a JSON API payload using
201
- [ jsonapi.UnmarshalPayload] ( http://godoc.org/github.com/moltin /jsonapi#UnmarshalPayload ) .
201
+ [ jsonapi.UnmarshalPayload] ( http://godoc.org/github.com/elasticpath /jsonapi#UnmarshalPayload ) .
202
202
It reads from an [ io.Reader] ( https://golang.org/pkg/io/#Reader )
203
203
containing a JSON API payload for one record (but can have related
204
204
records). Then, it materializes a struct that you created and passed in
@@ -207,7 +207,7 @@ the top level, in request payloads at the moment. Bulk creates and
207
207
updates are not supported yet.
208
208
209
209
After saving your record, you can use,
210
- [ MarshalOnePayload] ( http://godoc.org/github.com/moltin /jsonapi#MarshalOnePayload ) ,
210
+ [ MarshalOnePayload] ( http://godoc.org/github.com/elasticpath /jsonapi#MarshalOnePayload ) ,
211
211
to write the JSON API response to an
212
212
[ io.Writer] ( https://golang.org/pkg/io/#Writer ) .
213
213
@@ -217,15 +217,15 @@ to write the JSON API response to an
217
217
UnmarshalPayload (in io.Reader , model interface {})
218
218
```
219
219
220
- Visit [ godoc] ( http://godoc.org/github.com/moltin /jsonapi#UnmarshalPayload )
220
+ Visit [ godoc] ( http://godoc.org/github.com/elasticpath /jsonapi#UnmarshalPayload )
221
221
222
222
#### ` MarshalPayload `
223
223
224
224
``` go
225
225
MarshalPayload (w io.Writer , models interface {}) error
226
226
```
227
227
228
- Visit [ godoc] ( http://godoc.org/github.com/moltin /jsonapi#MarshalPayload )
228
+ Visit [ godoc] ( http://godoc.org/github.com/elasticpath /jsonapi#MarshalPayload )
229
229
230
230
Writes a JSON API response, with related records sideloaded, into an
231
231
` included ` array. This method encodes a response for either a single record or
@@ -261,7 +261,7 @@ func CreateBlog(w http.ResponseWriter, r *http.Request) {
261
261
UnmarshalManyPayload (in io.Reader , t reflect.Type ) ([]interface {}, error )
262
262
```
263
263
264
- Visit [ godoc] ( http://godoc.org/github.com/moltin /jsonapi#UnmarshalManyPayload )
264
+ Visit [ godoc] ( http://godoc.org/github.com/elasticpath /jsonapi#UnmarshalManyPayload )
265
265
266
266
Takes an ` io.Reader ` and a ` reflect.Type ` representing the uniform type
267
267
contained within the ` "data" ` JSON API member.
@@ -427,7 +427,7 @@ if err := validate(&myStructToValidate); err != nil {
427
427
MarshalOnePayloadEmbedded (w io.Writer , model interface {}) error
428
428
```
429
429
430
- Visit [ godoc] ( http://godoc.org/github.com/moltin /jsonapi#MarshalOnePayloadEmbedded )
430
+ Visit [ godoc] ( http://godoc.org/github.com/elasticpath /jsonapi#MarshalOnePayloadEmbedded )
431
431
432
432
This method is not strictly meant to for use in implementation code,
433
433
although feel free. It was mainly created for use in tests; in most cases,
@@ -467,13 +467,13 @@ I use git subtrees to manage dependencies rather than `go get` so that
467
467
the src is committed to my repo.
468
468
469
469
```
470
- git subtree add --squash --prefix=src/github.com/moltin /jsonapi https://github.com/moltin /jsonapi.git master
470
+ git subtree add --squash --prefix=src/github.com/elasticpath /jsonapi https://github.com/elasticpath /jsonapi.git master
471
471
```
472
472
473
473
To update,
474
474
475
475
```
476
- git subtree pull --squash --prefix=src/github.com/moltin /jsonapi https://github.com/moltin /jsonapi.git master
476
+ git subtree pull --squash --prefix=src/github.com/elasticpath /jsonapi https://github.com/elasticpath /jsonapi.git master
477
477
```
478
478
479
479
This assumes that I have my repo structured with a ` src ` dir containing
0 commit comments