Browse Source

Update doc strings based on feedback

Dj Gilcrease 10 years ago
parent
commit
f7ac7251e3
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      route.go

+ 10
- 4
route.go View File

@ -532,10 +532,11 @@ func (r *Route) URLPath(pairs ...string) (*url.URL, error) {
}, nil
}
// GetPathTemplate and GetHostTemplate returns the template used to match against for the route
// This is userful for building simple REST API documentation,
// and instrumentation for services like New Relic to ensure consistent reporting
// The route must have a path defined.
// GetPathTemplate returns the template used to build the
// route match.
// This is useful for building simple REST API documentation and for instrumentation
// against third-party services.
// An error will be returned if the route does not define a path.
func (r *Route) GetPathTemplate() (string, error) {
if r.err != nil {
return "", r.err
@ -546,6 +547,11 @@ func (r *Route) GetPathTemplate() (string, error) {
return r.regexp.path.template, nil
}
// GetHostTemplate returns the template used to build the
// route match.
// This is useful for building simple REST API documentation and for instrumentation
// against third-party services.
// An error will be returned if the route does not define a host.
func (r *Route) GetHostTemplate() (string, error) {
if r.err != nil {
return "", r.err


Loading…
Cancel
Save