ranger

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoundType

type BoundType uint8
const (
	INCLUSIVE BoundType = iota
	EXCLUSIVE
	OPEN
)

func (BoundType) String

func (i BoundType) String() string

type Range

type Range[T cmp.Ordered] struct {
	LowerBoundValue RangeBound[T]
	UpperBoundValue RangeBound[T]
}

func NewRange

func NewRange[T cmp.Ordered](lowerBoundValue RangeBound[T], upperBoundValue RangeBound[T]) *Range[T]

func (*Range[T]) Contains

func (ranger *Range[T]) Contains(v T) bool

func (*Range[T]) GetLowerBoundValue

func (ranger *Range[T]) GetLowerBoundValue() *RangeBound[T]

func (*Range[T]) GetUpperBoundValue

func (ranger *Range[T]) GetUpperBoundValue() *RangeBound[T]

type RangeBound

type RangeBound[T cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func Exclusive

func Exclusive[T cmp.Ordered](value T) RangeBound[T]

func Inclusive

func Inclusive[T cmp.Ordered](value T) RangeBound[T]

func NewRangeBound

func NewRangeBound[T cmp.Ordered](boundType BoundType, value T) RangeBound[T]

func Open

func Open[T cmp.Ordered]() RangeBound[T]

func (*RangeBound[T]) SetValue

func (bound *RangeBound[T]) SetValue(value T)

func (*RangeBound[T]) Type

func (bound *RangeBound[T]) Type() BoundType

func (*RangeBound[T]) Value

func (bound *RangeBound[T]) Value() T

type Ranger

type Ranger[T cmp.Ordered] interface {
	GetLowerBoundValue() *RangeBound[T]
	GetUpperBoundValue() *RangeBound[T]
	Contains(T) bool
}

Jump to

Keyboard shortcuts

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