This repository has been archived on 2022-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
tacitus/aggregation.go

27 lines
875 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)
MissingTimes(interval int, product string) (Results, error)
}