Documentation
¶
Index ¶
- Constants
- func SecToMilli(t uint32) int64
- type Candle
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) FirstCandleCloseTime() (int64, error)
- func (s *Storage) LastCandleCloseTime() (int64, error)
- func (s *Storage) Read(cs []Candle) (int, error)
- func (s *Storage) ReadAll() ([]Candle, error)
- func (s *Storage) ReadBack(cs []Candle) (int, error)
- func (s *Storage) Save(b []Candle) error
- func (s *Storage) SizeBytes() (int64, error)
- func (s *Storage) SizeCandles() (int64, error)
Constants ¶
View Source
const ( DefaultFilePerm = 0644 DefaultDirPerm = 0744 DefaultDataDir = "candles" DefaultExt = ".bin" CandleByteSize = 5 * 4 // 4 bytes for any field )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func DefaultStorage ¶
Use an existing file with default path
func NewDefaultStorage ¶
Create new file with default path
func NewFileStorage ¶
Create a new file from a path
func (*Storage) FirstCandleCloseTime ¶
return timestamp as milli seconds of the first candle
func (*Storage) LastCandleCloseTime ¶
return timestamp as milli seconds of the last candle
func (*Storage) Read ¶
Read bytes from the current data file and convert them to candles Returns the number of candle read and the error
func (*Storage) ReadBack ¶ added in v0.2.0
Read bytes from the end of the current data file and convert them to candles Returns the number of candle read and the error
func (*Storage) SizeCandles ¶
Returns length in candles for the current data file
Click to show internal directories.
Click to hide internal directories.