go-appbase: github.com/appbaseio/go-appbase/Godeps/_workspace/src/gopkg.in/olivere/elastic.v3/uritemplates Index | Files

package uritemplates

import "github.com/appbaseio/go-appbase/Godeps/_workspace/src/gopkg.in/olivere/elastic.v3/uritemplates"

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.ExpandString(values)


Package Files

uritemplates.go utils.go

func Expand Uses

func Expand(path string, expansions map[string]string) (string, error)

type UriTemplate Uses

type UriTemplate struct {
    // contains filtered or unexported fields

A UriTemplate is a parsed representation of a URI template.

func Parse Uses

func Parse(rawtemplate string) (template *UriTemplate, err error)

Parse parses a URI template string into a UriTemplate object.

func (*UriTemplate) Expand Uses

func (self *UriTemplate) Expand(value interface{}) (string, error)

Expand expands a URI template with a set of values to produce a string.

Package uritemplates imports 7 packages (graph) and is imported by 1 packages. Updated 2016-07-15. Refresh now. Tools for package owners.