top
(README.md)
go-radix [![Build Status](https://travis-ci.org/armon/go-radix.png)](https://travis-ci.org/armon/go-radix)
=========

Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree).
The package only provides a single `Tree` implementation, optimized for sparse nodes.

As a radix tree, it provides the following:
 * O(k) operations. In many cases, this can be faster than a hash table since
   the hash function is an O(k) operation, and hash tables have very poor cache locality.
 * Minimum / Maximum value lookups
 * Ordered iteration

For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix).

Documentation
=============

The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix).

Example
=======

Below is a simple example of usage

```go
// Create a tree
r := radix.New()
r.Insert("foo", 1)
r.Insert("bar", 2)
r.Insert("foobar", 2)

// Find the longest prefix match
m, _, _ := r.LongestPrefix("foozip")
if m != "foo" {
    panic("should be foo")
}
```

Imported by 396 package(s)

  1. github.com/2opremio/trifles/matcher
  2. github.com/42wim/consul/acl
  3. github.com/42wim/consul/consul/state
  4. github.com/AlexanderThaller/lablog/src/data
  5. github.com/Alistanis/consul/acl
  6. github.com/BRMatt/consul/acl
  7. github.com/BRMatt/consul/consul/state
  8. github.com/BrianHicks/consul/acl
  9. github.com/BrianHicks/consul/consul
  10. github.com/ErikDubbelboer/consul/acl
  11. github.com/GauntletWizard/vault/physical
  12. github.com/GauntletWizard/vault/vault
  13. github.com/HideoYamauchi/consul/acl
  14. github.com/HideoYamauchi/consul/consul/state
  15. github.com/JeffreyZksun/consul/acl
  16. github.com/KevinPike/vault/physical
  17. github.com/KevinPike/vault/vault
  18. github.com/Labutin/consul/acl
  19. github.com/Lafeng/dnspanic
  20. github.com/Lafeng/ezgoo
  21. github.com/LightKool/consul/acl
  22. github.com/MerlinDMC/consul/acl
  23. github.com/MrXiaoZ/consul/acl
  24. github.com/MrXiaoZ/consul/consul
  25. github.com/MustWin/consul/acl
  26. github.com/MustWin/consul/consul/state
  27. github.com/Mustwin/consul/acl
  28. github.com/Mustwin/consul/consul/state
  29. github.com/PumpkinSeed/consul/acl
  30. github.com/PumpkinSeed/consul/consul/state
  31. github.com/Test-Betta-Inc/upgraded-engine/acl
  32. github.com/Test-Betta-Inc/upgraded-engine/consul/state
  33. github.com/TheRealBill/consul/acl
  34. github.com/Wattpad/consul/acl
  35. github.com/Wattpad/consul/consul/state
  36. github.com/a16/fake-rtrd
  37. github.com/a16/gobgp/server
  38. github.com/a16/gobgp/table
  39. github.com/abhinavdahiya/consul/acl
  40. github.com/abhinavdahiya/consul/consul/state
  41. github.com/abronan/consul/acl
  42. github.com/abronan/consul/consul
  43. github.com/adriamb/vault-latch-hack/physical
  44. github.com/adriamb/vault-latch-hack/vault
  45. github.com/aksentyev/consul/acl
  46. github.com/aksentyev/consul/consul/state
  47. github.com/alistanis/consul/acl
  48. github.com/alistanis/consul/consul/state
  49. github.com/allencloud/libnetwork/networkdb
  50. github.com/alouche/consul/acl
  51. github.com/alouche/consul/consul
  52. github.com/aluzzardi/consul/acl
  53. github.com/aluzzardi/consul/consul
  54. github.com/amassanet/vault-latch-hack/physical
  55. github.com/amassanet/vault-latch-hack/vault
  56. github.com/andrewwatson/consul/acl
  57. github.com/asteris-llc/consul/acl
  58. github.com/ateleshev/consul/acl
  59. github.com/avishai-ish-shalom/consul/acl
  60. github.com/banyek/consul/acl
  61. github.com/banyek/consul/consul/state
  62. github.com/behance/consul/acl
  63. github.com/behance/consul/consul
  64. github.com/blalor/consul/acl
  65. github.com/bradobro/consul/acl
  66. github.com/brimstone/consul/acl
  67. github.com/buddhamagnet/consul/acl
  68. github.com/buddhamagnet/consul/consul
  69. github.com/buth/vault/physical
  70. github.com/buth/vault/vault
  71. github.com/bxxd/consul/acl
  72. github.com/bxxd/consul/consul/state
  73. github.com/byrnedo/consul/acl
  74. github.com/caiofilipini/consul/acl
  75. github.com/caiofilipini/consul/consul/state
  76. github.com/carlanton/consul/acl
  77. github.com/carlanton/consul/consul
  78. github.com/catsby/consul/acl
  79. github.com/ccpgames/vault/physical
  80. github.com/ccpgames/vault/vault
  81. github.com/cevaris/consul/acl
  82. github.com/chenyf/consul/acl
  83. github.com/chenyf/consul/consul
  84. github.com/chrishoffman/vault/physical
  85. github.com/chrishoffman/vault/vault
  86. github.com/christianberg/consul/acl
  87. github.com/clinta/libnetwork/networkdb
  88. github.com/clstokes/consul/acl
  89. github.com/codeout/gobgp/server
  90. github.com/codeout/gobgp/table
  91. github.com/coffeehc/consul/acl
  92. github.com/conseweb/consul/acl
  93. github.com/conseweb/consul/consul/state
  94. github.com/crufter/consul/acl
  95. github.com/cvvs/consul/acl
  96. github.com/cvvs/consul/consul/state
  97. github.com/d3xf/consul/acl
  98. github.com/dankennedy/consul/acl
  99. github.com/dankennedy/consul/consul
  100. github.com/darron/consul/acl
  101. github.com/darron/consul/consul/state
  102. github.com/datastream/libnetwork/networkdb
  103. github.com/dave-tucker/consul/acl
  104. github.com/dave-tucker/consul/consul
  105. github.com/daveadams/consul/acl
  106. github.com/daveadams/consul/consul
  107. github.com/daveadams/vault/physical
  108. github.com/daveadams/vault/vault
  109. github.com/derekchiang/consul/acl
  110. github.com/derekchiang/consul/consul
  111. github.com/dgryski/carbonmem
  112. github.com/dgryski/trifles/matcher
  113. github.com/discordianfish/consul/acl
  114. github.com/discordianfish/consul/consul
  115. github.com/docker/libnetwork/networkdb
  116. github.com/doubledutch/vault/physical
  117. github.com/doubledutch/vault/vault
  118. github.com/doublerebel/consul/acl
  119. github.com/duanbing/consul/acl
  120. github.com/duanbing/consul/consul/state
  121. github.com/durmaze/consul/acl
  122. github.com/durmaze/consul/consul/state
  123. github.com/eicca/consul/acl
  124. github.com/elcuervo/consul/acl
  125. github.com/elcuervo/consul/consul
  126. github.com/ellcrys/consul/acl
  127. github.com/ellcrys/consul/consul/state
  128. github.com/ericfode/consul/acl
  129. github.com/ericfode/consul/consul
  130. github.com/erikdubbelboer/consul/acl
  131. github.com/esell/vault/physical
  132. github.com/esell/vault/vault
  133. github.com/ezbercih/vault/physical
  134. github.com/ezbercih/vault/vault
  135. github.com/faiq/consul/acl
  136. github.com/faiq/consul/consul
  137. github.com/felixanya/vault/physical
  138. github.com/felixanya/vault/vault
  139. github.com/filipecabaco/vault/physical
  140. github.com/filipecabaco/vault/vault
  141. github.com/flei2000/vault/physical
  142. github.com/flei2000/vault/vault
  143. github.com/fntlnz/libnetwork/networkdb
  144. github.com/foostan/consul/acl
  145. github.com/fraenkel/consul/acl
  146. github.com/fraenkel/consul/consul
  147. github.com/fujita/gobgp/server
  148. github.com/fujita/gobgp/table
  149. github.com/fujita/routewatchd/watchdmain
  150. github.com/geckoboard/vault/physical
  151. github.com/geckoboard/vault/vault
  152. github.com/ghodss/consul/acl
  153. github.com/glennsb/vault/physical
  154. github.com/glennsb/vault/vault
  155. github.com/godeep/consul/acl
  156. github.com/gogolok/consul/acl
  157. github.com/gogolok/consul/consul
  158. github.com/graetzer/gobgp/server
  159. github.com/graetzer/gobgp/table
  160. github.com/grange74/consul/acl
  161. github.com/grange74/consul/consul/state
  162. github.com/grange74/vault/physical
  163. github.com/grange74/vault/vault
  164. github.com/grobie/consul/acl
  165. github.com/grubernaut/cli
  166. github.com/grunmax/telebot
  167. github.com/guillaume-morin/consul/acl
  168. github.com/guillaume-morin/consul/consul
  169. github.com/gulyasm/vault/physical
  170. github.com/gulyasm/vault/vault
  171. github.com/h2non/consul/acl
  172. github.com/hairyhenderson/consul/acl
  173. github.com/hairyhenderson/consul/consul/state
  174. github.com/hashicorp/consul/acl
  175. github.com/hashicorp/consul/consul/state
  176. github.com/hashicorp/vault/physical
  177. github.com/hashicorp/vault/vault
  178. github.com/hobbeswalsh/vault/physical
  179. github.com/hobbeswalsh/vault/vault
  180. github.com/hoffoo/consul/acl
  181. github.com/hooklift/consul/acl
  182. github.com/hpcloud/consul/acl
  183. github.com/iamthemuffinman/cli
  184. github.com/idubinskiy/consul/acl
  185. github.com/imcom/consul/acl
  186. github.com/imgix/consul/acl
  187. github.com/imkira/consul/acl
  188. github.com/imkira/consul/consul
  189. github.com/ishidawataru/gobgp/server
  190. github.com/ishidawataru/gobgp/table
  191. github.com/jamiealquiza/consul/acl
  192. github.com/jamiealquiza/consul/consul/state
  193. github.com/jangie/vault/physical
  194. github.com/jangie/vault/vault
  195. github.com/jaredonline/consul/acl
  196. github.com/jaredonline/consul/consul/state
  197. github.com/jbeda/vault/physical
  198. github.com/jbeda/vault/vault
  199. github.com/jefferai/consul/acl
  200. github.com/jefferai/consul/consul
  201. github.com/jefferai/vault/physical
  202. github.com/jefferai/vault/vault
  203. github.com/jgcallero/vault/physical
  204. github.com/jgcallero/vault/vault
  205. github.com/jhyle/mitmachrepublik/web
  206. github.com/jmitchell/consul/acl
  207. github.com/jmitchell/consul/consul
  208. github.com/jonlangemak/libnetwork/networkdb
  209. github.com/jonmorehouse/consul/acl
  210. github.com/joshuarubin/blamedns/blocker
  211. github.com/joshuarubin/blamedns/override
  212. github.com/joshuarubin/blamedns/whitelist
  213. github.com/jplock/consul/acl
  214. github.com/jpweber/vault/physical
  215. github.com/jpweber/vault/vault
  216. github.com/jsipprell/consul/acl
  217. github.com/jszwedko/vault/physical
  218. github.com/jszwedko/vault/vault
  219. github.com/juju2013/consul/acl
  220. github.com/juju2013/consul/consul
  221. github.com/justinclayton/consul/acl
  222. github.com/kevinpike/vault/physical
  223. github.com/kevinpike/vault/vault
  224. github.com/kikitux/consul/acl
  225. github.com/kikitux/consul/consul/state
  226. github.com/kimiazhu/consul/acl
  227. github.com/kimiazhu/consul/consul/state
  228. github.com/kingland/consul/acl
  229. github.com/kingland/consul/consul
  230. github.com/kkamperschroer/consul/acl
  231. github.com/kujenga/vault/physical
  232. github.com/kujenga/vault/vault
  233. github.com/kylemcc/consul/acl
  234. github.com/kylemcc/consul/consul/state
  235. github.com/legendtkl/consul/acl
  236. github.com/leocassarani/consul/acl
  237. github.com/leowmjw/consul/acl
  238. github.com/ljagiello/vault/physical
  239. github.com/ljagiello/vault/vault
  240. github.com/luizbafilho/gobgp/server
  241. github.com/luizbafilho/gobgp/table
  242. github.com/lvzhihao/cli
  243. github.com/macb/consul/acl
  244. github.com/macb/consul/consul
  245. github.com/marconi/consul/acl
  246. github.com/mark-rushakoff/consul/acl
  247. github.com/marouenj/consul/acl
  248. github.com/marouenj/consul/consul
  249. github.com/mattnenterprise/consul/acl
  250. github.com/mbruzek/consul/acl
  251. github.com/mbruzek/consul/consul
  252. github.com/mesos-utility/consul/acl
  253. github.com/mgood/consul/acl
  254. github.com/mgood/consul/consul
  255. github.com/milliant/consul/acl
  256. github.com/milliant/consul/consul
  257. github.com/mindscratch/consul/acl
  258. github.com/mitchellh/cli
  259. github.com/mpuncel/consul/acl
  260. github.com/mpuncel/consul/consul
  261. github.com/mrcrilly/consul/acl
  262. github.com/msoedov/consul/acl
  263. github.com/mssola/consul/acl
  264. github.com/mtchavez/consul/acl
  265. github.com/mtchavez/consul/consul/state
  266. github.com/myENA/consul/acl
  267. github.com/nathanielc/consul/acl
  268. github.com/nathanielc/consul/consul
  269. github.com/nrocine/vault/physical
  270. github.com/nrocine/vault/vault
  271. github.com/orivej/consul/acl
  272. github.com/orivej/git-compose
  273. github.com/osrg/gobgp/server
  274. github.com/osrg/gobgp/table
  275. github.com/papulovskiy/uber-sf-movies
  276. github.com/pdf/consul/acl
  277. github.com/pdf/consul/consul
  278. github.com/pedronasser/consul/acl
  279. github.com/pedronasser/consul/consul/state
  280. github.com/phylake/go-cli
  281. github.com/pshima/consul/acl
  282. github.com/raboof/consul/acl
  283. github.com/rafikk/consul/acl
  284. github.com/rafikk/consul/consul
  285. github.com/rboyer/consul/acl
  286. github.com/regorov/consul/acl
  287. github.com/replicatedcom/consul/acl
  288. github.com/rhencke/consul/acl
  289. github.com/rhettg/consul/acl
  290. github.com/rmt/vault/physical
  291. github.com/rmt/vault/vault
  292. github.com/robbiet480/consul/acl
  293. github.com/robbiet480/consul/consul
  294. github.com/robx/substrings
  295. github.com/roobert/consul/acl
  296. github.com/roobert/consul/consul
  297. github.com/rsrsps/consul/acl
  298. github.com/rsrsps/consul/consul
  299. github.com/rubenv/consul/acl
  300. github.com/ryanslade/consul/acl
  301. github.com/ryanuber/consul/acl
  302. github.com/ryanuber/consul/consul
  303. github.com/ryanuber/shortstr
  304. github.com/ryotarai/consul/acl
  305. github.com/ryotarai/consul/consul
  306. github.com/s7v7nislands/consul/acl
  307. github.com/saifabid/consul/acl
  308. github.com/samifruit514/consul/acl
  309. github.com/samifruit514/consul/consul/state
  310. github.com/saromanov/consul/acl
  311. github.com/sathiyas/consul/acl
  312. github.com/scorpionis/vault/physical
  313. github.com/scorpionis/vault/vault
  314. github.com/sdboyer/consul/acl
  315. github.com/sdboyer/consul/consul
  316. github.com/sdboyer/gps
  317. github.com/sdboyer/vsolver
  318. github.com/sebastianmarkow/consul/acl
  319. github.com/sebastianmarkow/consul/consul
  320. github.com/sequenceiq/consul/acl
  321. github.com/sethvargo/cli
  322. github.com/shahuwang/consul/acl
  323. github.com/shevchenkodenis/gobgp/server
  324. github.com/shevchenkodenis/gobgp/table
  325. github.com/shishir-a412ed/libnetwork/networkdb
  326. github.com/shoenig/consul/acl
  327. github.com/sitano/consul/acl
  328. github.com/sitano/consul/consul/state
  329. github.com/skyportsystems/consul/acl
  330. github.com/sneal/consul/acl
  331. github.com/sorenmat/consul/acl
  332. github.com/spencergibb/consul/acl
  333. github.com/spencergibb/consul/consul
  334. github.com/stackdocker/consul/acl
  335. github.com/stahnma/consul/acl
  336. github.com/stcatz/vault/physical
  337. github.com/stcatz/vault/vault
  338. github.com/sttts/consul/acl
  339. github.com/sttts/consul/consul
  340. github.com/suzuken/go-radix-gob-bench
  341. github.com/talwai/consul/acl
  342. github.com/tb594s/vault/physical
  343. github.com/tb594s/vault/vault
  344. github.com/thanhson1085/consul/acl
  345. github.com/therealbill/consul/acl
  346. github.com/therealbill/consul/consul/state
  347. github.com/thomaso-mirodin/vault/physical
  348. github.com/thomaso-mirodin/vault/vault
  349. github.com/threadwaste/consul/acl
  350. github.com/tiw/consul/acl
  351. github.com/tomdionysus/consul/acl
  352. github.com/tomdionysus/consul/consul
  353. github.com/tpounds/vault/physical
  354. github.com/tpounds/vault/vault
  355. github.com/tummychow/consul/acl
  356. github.com/tummychow/consul/consul
  357. github.com/udzura/consul/acl
  358. github.com/udzura/consul/consul
  359. github.com/umerazad/consul/acl
  360. github.com/vanhalt/vault/physical
  361. github.com/vanhalt/vault/vault
  362. github.com/vbatoufflet/vault/physical
  363. github.com/vbatoufflet/vault/vault
  364. github.com/vbatts/consul/acl
  365. github.com/vektra/consul/acl
  366. github.com/vetinari/vault/physical
  367. github.com/vetinari/vault/vault
  368. github.com/victortrac/consul/acl
  369. github.com/vivienschilis/consul/acl
  370. github.com/vrecan/consul/acl
  371. github.com/wangtuanjie/consul/acl
  372. github.com/wangtuanjie/consul/consul
  373. github.com/weaveworks/scope/probe/docker
  374. github.com/wjimenez5271/consul/acl
  375. github.com/wushukai/vault/physical
  376. github.com/wushukai/vault/vault
  377. github.com/wuub/consul/acl
  378. github.com/wuub/consul/consul
  379. github.com/xushiwei/consul/acl
  380. github.com/xushiwei/consul/consul
  381. github.com/youngsterxyf/consul/acl
  382. github.com/youngsterxyf/consul/consul/state
  383. github.com/ypyf/consul/acl
  384. github.com/ypyf/consul/consul/state
  385. github.com/zendesk/consul/acl
  386. github.com/zendesk/consul/consul
  387. github.com/zerklabs/consul/acl
  388. github.com/zerklabs/consul/consul
  389. github.com/zetaops/consul/acl
  390. github.com/zhang0137/consul/acl
  391. github.com/zhanghongquan/raccoon/common
  392. gopkg.in/hashicorp/consul.v0/acl
  393. gopkg.in/hashicorp/consul.v0/consul/state
  394. jrubin.io/blamedns/blocker
  395. jrubin.io/blamedns/override
  396. jrubin.io/blamedns/whitelist

Imported only in test by 3 package(s)

  1. github.com/fanyang01/glob
  2. github.com/fanyang01/radix
  3. github.com/smreed/strings