Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxUint = ^uint(0) MinUint = 0 MaxInt = int(MaxUint >> 1) MinInt = -MaxInt - 1 )
Constants
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶ added in v2.3.0
func Clamp[T constraints.Ordered](value, min, max T) T
Clamp limits value to a given minimum and maximum
func Maxv ¶
func Maxv[T constraints.Ordered](ints ...T) T
Maxv returns the largest int passed in the variadic argument.
func Minv ¶
func Minv[T constraints.Ordered](ints ...T) T
Minv returns the smallest int passed in the variadic argument.
Types ¶
type Decrementor ¶
type Decrementor struct {
// contains filtered or unexported fields
}
Decrementor defines a class that allows multiple threads/processes to act upon to decrement a counter
func NewDecrementor ¶
func NewDecrementor(initialMax int64) *Decrementor
NewDecrementor will return a reference to a Decrementor object
func (*Decrementor) Decrement ¶
func (decrementor *Decrementor) Decrement() int
Decrement will decrement by 1 the initial max the class was instantiated with
func (*Decrementor) GetInitialMax ¶
func (decrementor *Decrementor) GetInitialMax() int
GetInitialMax will return the inital maximum value that was set upon instantiation
Click to show internal directories.
Click to hide internal directories.