Documentation ¶
Index ¶
- Constants
- func IsFifoError(err error) bool
- func IsFifoErrorInsufficient(err error, code int) bool
- func IsFifoErrorNoEntry(err error, code int) bool
- type Asset
- type Entry
- type EntryList
- type Fifo
- func (f *Fifo) Add(assetName string, e Entry)
- func (f *Fifo) CouldTake(assetName string, units d.Decimal, decimals int32) bool
- func (f *Fifo) HasUnits(assetName string) bool
- func (f *Fifo) Print() string
- func (f *Fifo) Read(assetName string) Asset
- func (f *Fifo) Take(assetName string, units d.Decimal, decimals int32) (Asset, error)
- type FifoError
Constants ¶
View Source
const ( ERR_NO_ENTRY = iota ERR_INSUFFICIENT )
Variables ¶
This section is empty.
Functions ¶
func IsFifoError ¶
func IsFifoErrorInsufficient ¶
func IsFifoErrorNoEntry ¶
Types ¶
type Entry ¶
type EntryList ¶
type EntryList []Entry
func (EntryList) TotalUnits ¶
func (EntryList) TotalUnitsLeft ¶
type FifoError ¶
type FifoError struct { Code int RequiredAmount string MissingAmount string // contains filtered or unexported fields }
func NewFifoError ¶
func NewFifoTakeError ¶
Click to show internal directories.
Click to hide internal directories.