31 lines
432 B
Go
31 lines
432 B
Go
package internal
|
|
|
|
type Kind uint
|
|
|
|
const (
|
|
KindUnknown Kind = iota
|
|
KindBuy
|
|
KindSell
|
|
KindSplit
|
|
)
|
|
|
|
// String returns a human readable value
|
|
func (d Kind) String() string {
|
|
switch d {
|
|
case KindBuy:
|
|
return "buy"
|
|
case KindSell:
|
|
return "sell"
|
|
case KindSplit:
|
|
return "split"
|
|
default:
|
|
return "unknown"
|
|
}
|
|
}
|
|
|
|
// Is returns true when k equals o
|
|
func (k Kind) Is(o any) bool {
|
|
other, ok := o.(Kind)
|
|
return ok && k == other
|
|
}
|