Documentation ¶
Overview ¶
Package candle provides middleware utilities around candles. It wraps calls to the database.
Index ¶
- Variables
- type Candle
- type Core
- func (c Core) Create(ctx context.Context, nCdl NewCandle) (Candle, error)
- func (c Core) Query(ctx context.Context, pageNumber int, rowsPerPage int) ([]Candle, error)
- func (c Core) QueryByID(ctx context.Context, cdlID string) (Candle, error)
- func (c Core) QueryBySymbolAndInterval(ctx context.Context, pageNumber int, rowsPerPage int, sblID string, ...) ([]Candle, error)
- func (c Core) Seed(ctx context.Context, nCdl NewCandle, n int) error
- type NewCandle
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("candle not found") ErrAuthenticationFailure = errors.New("authentication failed") ErrInvalidID = errors.New("ID is not in its proper form") ErrInvalidCandle = errors.New("candle is not valid") )
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type Candle ¶
type Candle struct { ID string `json:"id"` SymbolID string `json:"symbol_id"` Symbol string `json:"symbol"` Interval string `json:"interval"` OpenTime time.Time `json:"open_time"` OpenPrice float64 `json:"open_price"` ClosePrice float64 `json:"close_price"` CloseTime time.Time `json:"close_time"` Low float64 `json:"low"` High float64 `json:"high"` Volume float64 `json:"volume"` }
Candle represents an individual candle
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core manages the set of API's for candle access.
func (Core) Create ¶
Create inserts a new candle into the database. The new candle is the last closed candle in binance for the given symbol / interval.
Click to show internal directories.
Click to hide internal directories.