renamed direction to side
This commit is contained in:
28
internal/side.go
Normal file
28
internal/side.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package internal
|
||||
|
||||
type Side uint
|
||||
|
||||
const (
|
||||
SideUnknown Side = iota
|
||||
SideBuy
|
||||
SideSell
|
||||
)
|
||||
|
||||
func (d Side) String() string {
|
||||
switch d {
|
||||
case SideBuy:
|
||||
return "buy"
|
||||
case SideSell:
|
||||
return "sell"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
func (d Side) IsBuy() bool {
|
||||
return d == SideBuy
|
||||
}
|
||||
|
||||
func (d Side) IsSell() bool {
|
||||
return d == SideSell
|
||||
}
|
||||
Reference in New Issue
Block a user