You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
708 B
34 lines
708 B
package exchange |
|
|
|
import ( |
|
vmts "sig-pub/pkg/storage/tsdb/victoria_metrics" |
|
"sig-pub/pkg/types" |
|
) |
|
|
|
type ExchangeDataService struct { |
|
vmdb *vmts.VictoriaMetricsTSDB |
|
exchangeFetch ExchangeFetcher |
|
} |
|
|
|
func NewExchangeDataService( |
|
vmdb *vmts.VictoriaMetricsTSDB, |
|
exchangeFetch ExchangeFetcher, |
|
) *ExchangeDataService { |
|
return &ExchangeDataService{ |
|
vmdb: vmdb, |
|
exchangeFetch: exchangeFetch, |
|
} |
|
} |
|
|
|
func (svc *ExchangeDataService) Init() (err error) { |
|
return |
|
} |
|
|
|
func (svc *ExchangeDataService) SaveKlines(inst types.TradeInstance, klines []*types.Kline) (err error) { |
|
err = svc.vmdb.SaveKlines(inst, klines) |
|
if err != nil { |
|
return |
|
} |
|
// todo klines 时间点回溯检查 |
|
return |
|
}
|
|
|