Skip to content

yageek/apiversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status GoDoc Report Cart MIT License

Versioning API with Go

Simple API versioning with Go with or without any middleware stack.

# Installation

go get -v github.com/yageek/apiversion

How it works

Vendor identifier

Before tagging a version, an API is identified by a vendor identifier with the form application/vnd.mybusiness.com. If it matches the value of the Accept header, the handler will next try find a version that suits your needs.

Version

AS you can registered several versions for your API, if you don't specify one, the last registered will be selected by default.

To select, one particular version, the handler will match the version specified after within the Accept header after the vendor identifier.

For example, to match the v2 version, the request Accept header will be:

Accept: application/vnd.mybusiness.com-v2

Usage

The package works out of the box as a simple HTTP handler or can be integrated easily with any middleware stack.

For usage, see examples folder.

About

Simple API versioning with Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages