Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedTrunk ¶
type CachedTrunk struct { *SimpleTrunk // contains filtered or unexported fields }
CachedTrunk is a Trunk with a LRU cache
func NewCachedTrunk ¶
func NewCachedTrunk(size int, numberOfFullList int) (*CachedTrunk, error)
NewCachedTrunk returns a new CachedTrunk
type SimpleTrunk ¶
type SimpleTrunk struct { *Node // contains filtered or unexported fields }
SimpleTrunk is a naïve Trunk, without any cache
func (*SimpleTrunk) Append ¶
func (t *SimpleTrunk) Append(nm *net.IPNet, data interface{})
func (*SimpleTrunk) Dump ¶
func (t *SimpleTrunk) Dump(w io.Writer)
func (*SimpleTrunk) Size ¶
func (t *SimpleTrunk) Size() int
type Trunk ¶
type Trunk interface { // Append an IP network, and a payload Append(nm *net.IPNet, data interface{}) // Get an IP, return a payload, and a boolean, true if the IP is in a registered network Get(ip net.IP) (interface{}, bool) // Size is the number of networks Size() int // Dump the tree, for debugging purpose Dump(w io.Writer) }
Trunk is the start of a tree storage
Click to show internal directories.
Click to hide internal directories.