rangeValues

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntContainer

type IntContainer[T Integer] struct {
	Value T
	Flags []string
}

IntContainer is a container for an integer with some additional flags. With standard methods, it will be parsed as "1234:flag1:flag2:flag3" as in, first part has to be an integer, and next parts will be considered as flag.

func ParseIntContainer

func ParseIntContainer[T Integer](value string) *IntContainer[T]

func (*IntContainer[T]) HasFlag

func (c *IntContainer[T]) HasFlag(flags ...string) bool

type Integer

type Integer interface {
	~int64 | ~int | ~int32 | ~int16 | ~int8 | ~uint64 | ~uint | ~uint32 | ~uint16 | ~uint8
}

type IntegerRange

type IntegerRange[T Integer] struct {
	Min T
	Max T
}

func (*IntegerRange[T]) GetRandom

func (r *IntegerRange[T]) GetRandom() T

func (*IntegerRange[T]) IsInRange

func (r *IntegerRange[T]) IsInRange(value T) bool

func (*IntegerRange[T]) IsValueInRange

func (r *IntegerRange[T]) IsValueInRange(value *IntegerRange[T]) bool

type RangeFloat64

type RangeFloat64 struct {
	Min float64
	Max float64
}

func (*RangeFloat64) IsInRange

func (r *RangeFloat64) IsInRange(value float64) bool

func (*RangeFloat64) IsNaN

func (r *RangeFloat64) IsNaN() bool

func (*RangeFloat64) IsValueInRange

func (r *RangeFloat64) IsValueInRange(value *RangeFloat64) bool

Jump to

Keyboard shortcuts

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