1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #6748 from LK4D4/increase_max_patricia_prefix

Increase max patricia prefix
This commit is contained in:
Tibor Vass 2014-07-01 19:03:30 -04:00
commit b0824edc7c
5 changed files with 22 additions and 18 deletions

View file

@ -47,7 +47,7 @@ clone git github.com/gorilla/mux 136d54f81f
clone git github.com/syndtr/gocapability 3c85049eae clone git github.com/syndtr/gocapability 3c85049eae
clone git github.com/tchap/go-patricia v1.0.0 clone git github.com/tchap/go-patricia v1.0.1
clone hg code.google.com/p/go.net 84a4013f96e0 clone hg code.google.com/p/go.net 84a4013f96e0

View file

@ -13,6 +13,12 @@ var (
ErrNoID = errors.New("prefix can't be empty") ErrNoID = errors.New("prefix can't be empty")
) )
func init() {
// Change patricia max prefix per node length,
// because our len(ID) always 64
patricia.MaxPrefixPerNode = 64
}
// TruncIndex allows the retrieval of string identifiers by any of their unique prefixes. // TruncIndex allows the retrieval of string identifiers by any of their unique prefixes.
// This is used to retrieve image and container IDs by more convenient shorthand prefixes. // This is used to retrieve image and container IDs by more convenient shorthand prefixes.
type TruncIndex struct { type TruncIndex struct {

View file

@ -1,9 +0,0 @@
language: go
go:
- 1.2
- tip
branches:
exclude:
- wip

View file

@ -1,8 +1,10 @@
# go-patricia # # go-patricia #
**Documentation**: [GoDoc](http://godoc.org/github.com/tchap/go-patricia/patricia)<br /> **Documentation**: [GoDoc](http://godoc.org/github.com/tchap/go-patricia/patricia)<br />
**Build Status**: [![Build Status](https://travis-ci.org/tchap/go-patricia.png?branch=master)](https://travis-ci.org/tchap/go-patricia)<br > **Build Status**: [![Build
**Test Coverage**: Comming as soon as Drone.io people update their Go. Status](https://drone.io/github.com/tchap/go-patricia/status.png)](https://drone.io/github.com/tchap/go-patricia/latest)<br />
**Test Coverage**: [![Coverage
Status](https://coveralls.io/repos/tchap/go-patricia/badge.png)](https://coveralls.io/r/tchap/go-patricia)
## About ## ## About ##
@ -34,6 +36,12 @@ Import the package from GitHub first.
import "github.com/tchap/go-patricia/patricia" import "github.com/tchap/go-patricia/patricia"
``` ```
You can as well use gopkg.in thingie:
```go
import "gopkg.in/tchap/go-patricia.v1/patricia"
```
Then you can start having fun. Then you can start having fun.
```go ```go

View file

@ -5,12 +5,11 @@
package patricia package patricia
const ( // Max prefix length that is kept in a single trie node.
// Max prefix length that is kept in a single trie node. var MaxPrefixPerNode = 10
MaxPrefixPerNode = 10
// Max children to keep in a node in the sparse mode. // Max children to keep in a node in the sparse mode.
MaxChildrenPerSparseNode = 8 const MaxChildrenPerSparseNode = 8
)
type childList interface { type childList interface {
length() int length() int