func NewMatchEntry(path string) *MatchEntry {
	p := C.CString(path)
	e := C.match_entry_createl(p, C.int(C.strlen(p)))
	return &MatchEntry{
		entry: e,
	}
}
creates a new MatchEntry
package r3
import "C"
import "unsafe"
import (
	"errors"
)
var (
	MethodGet     Method = C.METHOD_GET
	MethodPost    Method = C.METHOD_POST
	MethodPut     Method = C.METHOD_PUT
	MethodDelete  Method = C.METHOD_DELETE
	MethodPatch   Method = C.METHOD_PATCH
	MethodHead    Method = C.METHOD_HEAD
	MethodOptions Method = C.METHOD_OPTIONS
	MethodAll     Method = C.METHOD_GET | C.METHOD_POST | C.METHOD_PUT | C.METHOD_DELETE | C.METHOD_PATCH | C.METHOD_HEAD | C.METHOD_OPTIONS
)
type Method int
type Node struct {
	node  *C.node
	datas []interface{}
}
type Data struct {
	Value interface{}
}
type Tree Node
func (n *Node) Data() interface{} {
	var p *Data
	p = (*Data)(C.getNodeData(n.node))
	return p.Value
}
func NewTree(capacity int) *Tree {
	var n *C.node
	n = C.r3_tree_create(C.int(capacity))
	t := &Tree{
		node:  n,
		datas: make([]interface{}, 0, 10),
	}
	return t
}
func (n *Tree) InsertRoute(m Method, path string, data interface{}) {
	d := &Data{
		Value: data,
	}
	p := C.CString(path)
	n.datas = append(n.datas, d)
	C.r3_tree_insert_routel(n.node, C.int(m), p, C.int(C.strlen(p)), unsafe.Pointer(d))
}
func (n *Tree) InsertPath(path string, data interface{}) {
	d := &Data{
		Value: data,
	}
	n.datas = append(n.datas, d)
	p := C.CString(path)
	C.r3_tree_insert_pathl(n.node, p, C.int(C.strlen(p)), unsafe.Pointer(d))
}
func (n *Tree) Compile() error {
	var err C.int
	var errstr *C.char
	err = C.r3_tree_compile(n.node, &errstr)
	if err != 0 {
		defer C.free(unsafe.Pointer(errstr))
		return errors.New(C.GoString(errstr))
	}
	return nil
}
func (n *Tree) MatchRoute(e *MatchEntry) *Route {
	r := C.r3_tree_match_route(n.node, e.entry)
	if r == nil {
		return nil
	}
	return &Route{
		route: r,
	}
}
func (n *Tree) MatchNode(e *MatchEntry) *Node {
	ret := C.treeMatchEntry(n.node, e.entry)
	if ret == nil {
		return nil
	}
	return &Node{
		node: ret,
	}
}
func (n *Tree) Free() {
	C.r3_tree_free(n.node)
	n.node = nil
	n.datas = nil
}
func (n *Tree) Dump() {
	C.r3_tree_dump(n.node, 0)
}
type MatchEntry struct {
	entry *C.match_entry
}