Documentation
¶
Index ¶
- type Candle
- type InfluxDBStorage
- func (s *InfluxDBStorage) Close() error
- func (s *InfluxDBStorage) DeleteSymbol(symbol string) error
- func (s *InfluxDBStorage) GetCandles(symbol string, startTime int64, endTime int64) ([]*Candle, error)
- func (s *InfluxDBStorage) GetLatestCandles(symbol string, limit int) ([]*Candle, error)
- func (s *InfluxDBStorage) StoreCandle(symbol string, candle *Candle) error
- func (s *InfluxDBStorage) StoreCandles(symbol string, candles []*Candle) error
- type Storage
- type TimescaleDBStorage
- func (s *TimescaleDBStorage) Close() error
- func (s *TimescaleDBStorage) DeleteSymbol(symbol string) error
- func (s *TimescaleDBStorage) GetCandles(symbol string, startTime int64, endTime int64) ([]*Candle, error)
- func (s *TimescaleDBStorage) GetLatestCandles(symbol string, limit int) ([]*Candle, error)
- func (s *TimescaleDBStorage) StoreCandle(symbol string, candle *Candle) error
- func (s *TimescaleDBStorage) StoreCandles(symbol string, candles []*Candle) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Candle ¶
type Candle struct {
Symbol string
Timestamp int64
Open float64
High float64
Low float64
Close float64
Volume float64
}
Candle represents OHLCV data stored in database
type InfluxDBStorage ¶
type InfluxDBStorage struct {
// contains filtered or unexported fields
}
InfluxDBStorage implements Storage interface using InfluxDB
func NewInfluxDBStorage ¶
func NewInfluxDBStorage(dsn, database string) (*InfluxDBStorage, error)
NewInfluxDBStorage creates a new InfluxDB storage instance
func (*InfluxDBStorage) Close ¶
func (s *InfluxDBStorage) Close() error
Close closes InfluxDB connection TODO: Implement InfluxDB close logic
func (*InfluxDBStorage) DeleteSymbol ¶
func (s *InfluxDBStorage) DeleteSymbol(symbol string) error
DeleteSymbol removes all data for a symbol from InfluxDB TODO: Implement InfluxDB delete logic
func (*InfluxDBStorage) GetCandles ¶
func (s *InfluxDBStorage) GetCandles(symbol string, startTime int64, endTime int64) ([]*Candle, error)
GetCandles retrieves candles from InfluxDB TODO: Implement InfluxDB query logic
func (*InfluxDBStorage) GetLatestCandles ¶
func (s *InfluxDBStorage) GetLatestCandles(symbol string, limit int) ([]*Candle, error)
GetLatestCandles retrieves recent candles from InfluxDB TODO: Implement InfluxDB latest query logic
func (*InfluxDBStorage) StoreCandle ¶
func (s *InfluxDBStorage) StoreCandle(symbol string, candle *Candle) error
StoreCandle stores a single candle in InfluxDB TODO: Implement InfluxDB client connection and write logic
func (*InfluxDBStorage) StoreCandles ¶
func (s *InfluxDBStorage) StoreCandles(symbol string, candles []*Candle) error
StoreCandles stores multiple candles in InfluxDB TODO: Implement InfluxDB batch write logic
type Storage ¶
type Storage interface {
// StoreCandle stores a single candle in the database
StoreCandle(symbol string, candle *Candle) error
// StoreCandles stores multiple candles in the database
StoreCandles(symbol string, candles []*Candle) error
// GetCandles retrieves candles for a symbol within a time range
GetCandles(symbol string, startTime int64, endTime int64) ([]*Candle, error)
// GetLatestCandles retrieves the most recent N candles for a symbol
GetLatestCandles(symbol string, limit int) ([]*Candle, error)
// DeleteSymbol removes all data for a symbol
DeleteSymbol(symbol string) error
// Close closes the database connection
Close() error
}
Storage represents a generic time series storage interface
type TimescaleDBStorage ¶
type TimescaleDBStorage struct {
// contains filtered or unexported fields
}
TimescaleDBStorage implements Storage interface using TimescaleDB (PostgreSQL extension)
func NewTimescaleDBStorage ¶
func NewTimescaleDBStorage(dsn string) (*TimescaleDBStorage, error)
NewTimescaleDBStorage creates a new TimescaleDB storage instance
func (*TimescaleDBStorage) Close ¶
func (s *TimescaleDBStorage) Close() error
Close closes TimescaleDB connection TODO: Implement TimescaleDB close logic
func (*TimescaleDBStorage) DeleteSymbol ¶
func (s *TimescaleDBStorage) DeleteSymbol(symbol string) error
DeleteSymbol removes all data for a symbol from TimescaleDB TODO: Implement TimescaleDB delete logic
func (*TimescaleDBStorage) GetCandles ¶
func (s *TimescaleDBStorage) GetCandles(symbol string, startTime int64, endTime int64) ([]*Candle, error)
GetCandles retrieves candles from TimescaleDB TODO: Implement TimescaleDB query logic
func (*TimescaleDBStorage) GetLatestCandles ¶
func (s *TimescaleDBStorage) GetLatestCandles(symbol string, limit int) ([]*Candle, error)
GetLatestCandles retrieves recent candles from TimescaleDB TODO: Implement TimescaleDB latest query logic
func (*TimescaleDBStorage) StoreCandle ¶
func (s *TimescaleDBStorage) StoreCandle(symbol string, candle *Candle) error
StoreCandle stores a single candle in TimescaleDB TODO: Implement TimescaleDB client connection and insert logic
func (*TimescaleDBStorage) StoreCandles ¶
func (s *TimescaleDBStorage) StoreCandles(symbol string, candles []*Candle) error
StoreCandles stores multiple candles in TimescaleDB TODO: Implement TimescaleDB batch insert logic