Documentation
¶
Overview ¶
Package merger implements streaming network merge algorithm using nested iteration.
The merger processes networks from multiple MMDB databases, resolving overlaps by selecting the smallest network at each point. Adjacent networks with identical data are automatically merged for compact output. The streaming accumulator ensures O(1) memory usage regardless of database size.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccumulatedRange ¶
type AccumulatedRange struct {
StartIP netip.Addr
EndIP netip.Addr
Data []mmdbtype.DataType // column values ordered by config.Columns
}
AccumulatedRange represents a continuous IP range with associated data.
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
Accumulator accumulates adjacent networks with identical data and flushes them as CIDRs when data changes. This enables O(1) memory usage.
func NewAccumulator ¶
func NewAccumulator(writer RowWriter, includeEmptyRows bool, pool *slicePool) *Accumulator
NewAccumulator creates a new streaming accumulator.
func (*Accumulator) Flush ¶
func (a *Accumulator) Flush() error
Flush writes the current accumulated range as one or more CIDR rows. An accumulated range may produce multiple CIDRs if it doesn't align perfectly.
type Merger ¶
type Merger struct {
// contains filtered or unexported fields
}
Merger handles merging multiple MMDB databases into a single output stream.
type RangeRowWriter ¶
RangeRowWriter can accept full start/end ranges instead of prefixes.