ranges

package
v0.0.0-...-b8483cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Added   = +1
	Existed = 0
	Full    = math.MaxInt / 2 // half so increment won't overflow
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ranges

type Ranges struct {
	// contains filtered or unexported fields
}

Ranges is an ordered set of non-overlapping ranges of strings. Ranges are inclusive e.g. Insert(from, to) means: from <= x <= to. The zero value is ready to use. It uses a specialized in-memory btree with a max size and number of levels. Nodes are fixed size to reduce allocation and bounds checks. ordset uses a variation of this code.

func (*Ranges) Contains

func (rs *Ranges) Contains(val string) bool

func (*Ranges) Insert

func (rs *Ranges) Insert(from, to string) int

func (*Ranges) String

func (rs *Ranges) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL