25 lines
530 B
Go
25 lines
530 B
Go
package repository
|
|
|
|
import (
|
|
"blockchain/internal/domain/entity"
|
|
"context"
|
|
)
|
|
|
|
type DataSourceRepository interface {
|
|
GetSymbols(ctx context.Context) ([]*entity.Symbol, error)
|
|
Downloader
|
|
}
|
|
|
|
type Downloader interface {
|
|
// FetchHistoryKline 抓歷史 K 線資料
|
|
FetchHistoryKline(ctx context.Context, param QueryKline) ([]*entity.Kline, error)
|
|
SaveHistoryKline(ctx context.Context, data []*entity.Kline) error
|
|
}
|
|
|
|
type QueryKline struct {
|
|
Symbol string
|
|
Interval string
|
|
StartUnixNano int64
|
|
EndUnixNano int64
|
|
}
|