requestmigrations is a Golang implementation of rolling versions for REST APIs. It's a port of the Ruby implementation by ezekg. We use it in production at Convoy.
Note
This README describes v2 of requestmigrations that is currently experimental. For older versions, please check the release tags.
- API Versioning with date and semver versioning support.
- Prometheus Instrumentation to track and optimize slow transformations.
- Type-based migration system.
go get github.com/subomi/requestmigrations/v2RequestMigrations introduces a type-based migration system. Instead of defining migrations per API handler, migrations are now defined per Go type.
package main
import (
rms "github.com/subomi/requestmigrations/v2"
)
func main() {
rm, _ := rms.NewRequestMigration(&rms.RequestMigrationOptions{
VersionHeader: "X-API-Version",
CurrentVersion: "2024-01-01",
VersionFormat: rms.DateFormat,
})
// Register migrations for a specific type
rms.Register[User](rm, "2024-01-01", &UserMigration{})
}Check the examples directory for full examples.
MIT License