example

command
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 3 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL