func (t *Trie) Get(path, version string) (*Trie, string, string, bool) {
	key, path := t.SplitPath(path)
	if node, ok := t.contains(key, version); ok {
		if path == "" {
			return node, key, path, true
		}
		return node.Get(path, version)
	}
	return t, key, path, false
}
Get returns a node
package violetear
import (
	"errors"
	"net/http"
	"strings"
)
type MethodHandler struct {
	Method  string
	Handler http.Handler
}
type Trie struct {
	Handler     []MethodHandler
	HasCatchall bool
	HasRegex    bool
	Node        []*Trie
	name        string
	path        string
	version     string
}
func (t *Trie) contains(path, version string) (*Trie, bool) {
	for _, n := range t.Node {
		if n.path == path && n.version == version {
			return n, true
		}
	}
	return nil, false
}
func (t *Trie) Set(path []string, handler http.Handler, method, version string) (*Trie, error) {
	if len(path) == 0 {
		return nil, errors.New("path cannot be empty")
	}
	key := path[0]
	newpath := path[1:]
	node, ok := t.contains(key, version)
	if !ok {
		node = &Trie{
			path:    key,
			version: version,
		}
		t.Node = append(t.Node, node)
		if strings.HasPrefix(key, ":") {
			t.HasRegex = true
		}
		if key == "*" {
			t.HasCatchall = true
		}
	}
	if len(newpath) == 0 {
		methods := strings.FieldsFunc(method, func(c rune) bool {
			return c == ','
		})
		for _, v := range methods {
			node.Handler = append(node.Handler, MethodHandler{strings.ToUpper(strings.TrimSpace(v)), handler})
		}
		return node, nil
	}
	if key == "*" {
		return nil, errors.New("catch-all \"*\" must always be the final path element")
	}
	return node.Set(newpath, handler, method, version)
}