types

package
v0.0.0-...-25a6cea Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ErrInvalidCapacity = SentinelError("capacity not within range [0,1]")

Variables

This section is empty.

Functions

This section is empty.

Types

type Capacity

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

func NewCapacity

func NewCapacity(cap float64) (Capacity, error)

func (Capacity) Equal

func (c Capacity) Equal(other Capacity) bool

func (Capacity) MaxAvailable

func (c Capacity) MaxAvailable(totalUnits int64) int64

func (Capacity) String

func (c Capacity) String() string

func (Capacity) Value

func (c Capacity) Value() float64

type SentinelError

type SentinelError string

SentinelError is type for defining constant error values.

Inspired by: https://dave.cheney.net/2019/06/10/constant-time

func (SentinelError) Error

func (e SentinelError) Error() string

Error returns the string value of a SentinelError.

Jump to

Keyboard shortcuts

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