Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
__snapshots__
README.md
main.go
main_test.go
user.go
versions.go

README.md

example

This is an example API that uses pinned to manage versions.

In this example, the API maintains three versions.

2018-03-09 - Rename User.FullName -> User.Name
2018-02-09 - Add User.CreatedAt
2018-01-09 - Initial.

If a request does not specify a version, or requests the latest, no changes are made. If a request is made for 2018-02-09, the changes defined in 2018-03-09 are executed. If a request is made for 2018-01-09, the changes defined in 2018-03-09 and 2018-02-09 are executed in order.

To see what this actually looks like, look at snapshots/example.snapshot.

Testing

Tests are written using abide. This makes it very simple to snapshot each version of a given API route and ensure future changes keep previous versions stable.

$ go test -v -race
You can’t perform that action at this time.