As mentioned previously, Echo employs a Radix Tree data structure and search algorithm to find the correct handler for a given resource identifier. A Radix Tree is a prefix tree, where each parent node in the tree represents a prefix of the child node. In our use case, since we are obviously performing string matching, a prefix tree is the appropriate tool for the job. The following is an extremely simplified diagram that explains how a Radix Tree works for our book-long project:
The preceding diagram assumes the following routes were added to our project, which can be seen in our sample code located at: $GOPATH/src/github.com/PacktPublishing/Echo-Essentials/chapter3/cmd/service/main.go ...