27 lines
489 B
Go
27 lines
489 B
Go
|
package tacitus
|
||
|
|
||
|
import (
|
||
|
"github.com/shopspring/decimal"
|
||
|
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type Trade struct {
|
||
|
Id int
|
||
|
TradeId int
|
||
|
Product string
|
||
|
Price decimal.Decimal
|
||
|
Size decimal.Decimal
|
||
|
Buy bool
|
||
|
Sell bool
|
||
|
Timestamp time.Time
|
||
|
}
|
||
|
|
||
|
type TradeService interface {
|
||
|
Trade(id int) (*Trade, error)
|
||
|
TradeByTradeId(id int, prod string) (*Trade, error)
|
||
|
CreateTrade(t *Trade) error
|
||
|
DeleteTrade(id int)
|
||
|
TradesInDateRange(product string, start, end time.Time) ([]Trade, error)
|
||
|
}
|