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