Skip to content

Commit

Permalink
add migration notice for v1 to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Nov 16, 2020
1 parent 5ab21d4 commit b7ba895
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Import the library into your tool:
import "github.com/fastly/go-fastly/fastly"
```

## Migrating from v1 to v2

The move from major version 1 to 2 as resulted in a couple of fundamental changes to the library:

- Consistent field name format for `ServiceID`, `ServiceVersion`, `DictionaryID`, `PoolID`.
- Input struct fields (for write/update operations) that are optional (i.e. `omitempty`) and use basic types, are now defined as pointers.

> Note: [basic types](https://tour.golang.org/basics/11) that are _optional_, must be provided as pointers to avoid unexpected behaviours when dealing with their zero value ([reference](https://willnorris.com/2014/05/go-rest-apis-and-pointers/)). We provide helper functions for this [here](./fastly/basictypes_helper.go).
## Examples

Fastly's API is designed to work in the following manner:
Expand Down Expand Up @@ -122,8 +131,6 @@ if err != nil {
fmt.Printf("%t\n", activeVersion.Locked)
```

> Note: [basic types](https://tour.golang.org/basics/11) that are _optional_, must be provided as pointers to avoid unexpected behaviours when dealing with their zero value ([reference](https://willnorris.com/2014/05/go-rest-apis-and-pointers/)). We provide helper functions for this [here](./fastly/basictypes_helper.go).
More information can be found in the
[Fastly Godoc][godocs].

Expand Down

0 comments on commit b7ba895

Please sign in to comment.