26 lines
814 B
Go
26 lines
814 B
Go
|
package tacitus
|
||
|
|
||
|
import (
|
||
|
"github.com/shopspring/decimal"
|
||
|
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type Aggregation struct {
|
||
|
Id int `json:"id"`
|
||
|
Interval int `json:"interval"`
|
||
|
Product string `json:"product"`
|
||
|
Price decimal.Decimal `json:"price"`
|
||
|
BuyVolume decimal.Decimal `json:"buy_volume"`
|
||
|
SellVolume decimal.Decimal `json:"sell_volume"`
|
||
|
BuyTransactions int `json:"buy_transactions"`
|
||
|
SellTransactions int `json:"sell_transactions"`
|
||
|
Timestamp time.Time `json:"timestamp"`
|
||
|
}
|
||
|
|
||
|
type AggregationService interface {
|
||
|
Aggregation(interval int, product string, timestamp time.Time) (Aggregation, error)
|
||
|
CreateAggregation(a Aggregation) (Aggregation, error)
|
||
|
UpdateAggregation(a Aggregation) (Aggregation, error)
|
||
|
}
|