tradetype

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTradeType ...
	ErrInvalidTradeType = errors.New("trade type must be either BUY or SELL")
)

Functions

This section is empty.

Types

type TradeType

type TradeType int
const (
	// Buy type
	Buy TradeType = iota
	// Sell type
	Sell
)

func (TradeType) IsBuy

func (t TradeType) IsBuy() bool

IsBuy returns whether the current trade type is BUY

func (TradeType) IsSell

func (t TradeType) IsSell() bool

IsSell returns whether the current trade type is SELL

func (TradeType) String

func (t TradeType) String() string

String formats the type to a human-readable form

func (TradeType) Validate

func (t TradeType) Validate() error

Validate makes sure that the current trade type is either BUY or SELL

Jump to

Keyboard shortcuts

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