ranger

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 2 Imported by: 0

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