func NewRouter(rtf RootTreeFunc, hm HandlerMap, eh TravelErrorHandler, o *TravelOptions) (*Router, error) {
	if o == nil {
		o = &TravelOptions{
			SubpathMaxLength: map[string]int{},
		}
	}
	if o.UseDefaultHandler {
		if _, ok := hm[o.DefaultHandler]; !ok {
			return &Router{}, InternalError("Default handler not found in handler map")
		}
	}
	return &Router{
		rtf:     rtf,
		hm:      hm,
		eh:      eh,
		options: o,
	}, nil
}
Create a new Travel router. Parameters: callback function to fetch root tree, map of handler names to functions,
default request error handler, options
package travel
import (
	"net/http"
	"strings"
)
const (
	UnlimitedSubpath = -1  
	h_token          = "%handler"
)
type TravelHandler func(http.ResponseWriter, *http.Request, *Context)
type TravelErrorHandler func(http.ResponseWriter, *http.Request, TraversalError)
type RootTreeFunc func() (map[string]interface{}, error)
type HandlerMap map[string]TravelHandler
type TravelOptions struct {
	SubpathMaxLength  map[string]int  
	StrictTraversal   bool            
	UseDefaultHandler bool            
	DefaultHandler    string          
}
type Context struct {
	RootTree   map[string]interface{}  
	CurrentObj interface{}             
	Path       []string                
	Subpath    []string                
	options    *TravelOptions          
	req        *http.Request
	rtf        RootTreeFunc
}
type Router struct {
	rtf     RootTreeFunc
	hm      HandlerMap
	eh      TravelErrorHandler
	options *TravelOptions
}
type TraversalResult struct {
	h  string       
	co interface{}  
	sp []string     
}