URI Templates (RFC 6570) implemented in Go
Go
Latest commit 307ae86 Jul 2, 2016 Joshua Tacoma Correct LICENSE to fix #9
Failed to load latest commit information.
tests @ fdd5d61
.gitignore
.gitmodules
.godocdown.md
.travis.yml
LICENSE
README.md
uritemplates.go
uritemplates_test.go

README.md

uritemplates

import "github.com/jtacoma/uritemplates"

Build Status Coverage Status

Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).

To use uritemplates, parse a template string and expand it with a value map:

template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}")
values := make(map[string]interface{})
values["user"] = "jtacoma"
values["repo"] = "uritemplates"
expanded, _ := template.Expand(values)
fmt.Printf(expanded)

License

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.