Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveRelative ¶
ResolveRelative resolves relatives such as "http://www.golang.org/" and "topics/myproject/mytopic" into a single string, such as "http://www.golang.org/topics/myproject/mytopic". It strips all parent references (e.g. ../..) as well as anything after the host (e.g. /bar/gaz gets stripped out of foo.com/bar/gaz).
ResolveRelative panics if either basestr or relstr is not able to be parsed.
Types ¶
type ParseError ¶
func (ParseError) Error ¶
func (pe ParseError) Error() string
type PathTemplate ¶
type PathTemplate struct {
// contains filtered or unexported fields
}
PathTemplate manages the template to build and match with paths used by API services. It holds a template and variable names in it, and it can extract matched patterns from a path string or build a path string from a binding.
See http.proto in github.com/googleapis/googleapis/ for the details of the template syntax.
func MustCompilePathTemplate ¶
func MustCompilePathTemplate(template string) *PathTemplate
MustCompilePathTemplate is like NewPathTemplate but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding compiled regular expressions.
func NewPathTemplate ¶
func NewPathTemplate(template string) (*PathTemplate, error)
NewPathTemplate parses a path template, and returns a PathTemplate instance if successful.