Documentation ¶
Index ¶
Constants ¶
View Source
const JSONTimeFormat = time.RFC3339
Variables ¶
View Source
var CandleResolutionMap = map[CandleResolution]struct{}{ Minute: {}, FiveMinutes: {}, FifteenMinutes: {}, Day: {}, Week: {}, Month: {}, }
Functions ¶
This section is empty.
Types ¶
type Candle ¶
type Candle struct { Symbol string `json:"symbol"` Resolution CandleResolution `json:"resolution"` From time.Time `json:"from"` To time.Time `json:"to"` Data CandleData `json:"data"` }
type CandleData ¶
type CandleData struct { // Open - open prices Open []float32 `json:"open"` // Close - close prices Close []float32 `json:"close"` // High - high prices High []float32 `json:"high"` // Low - low prices Low []float32 `json:"low"` // Volume - volume data Volume []int `json:"volume"` // List of timestamps in UNIX format Timestamps []int64 `json:"timestamps"` }
type CandleRPCRequest ¶
type CandleRPCRequest struct { Symbol string `json:"symbol"` Resolution CandleResolution `json:"resolution"` // From - UNIX time From int64 `json:"from"` // To - UNIX time To int64 `json:"to"` }
type CandleRabbit ¶
type CandleRabbit struct { // Open - open prices Open []float32 `json:"o"` // Close - close prices Close []float32 `json:"c"` // High - high prices High []float32 `json:"h"` // Low - low prices Low []float32 `json:"l"` // Volume - volume data Volume []int `json:"v"` // List of timestamps in UNIX format Timestamps []int64 `json:"t"` // Status of the response. // This field can either be `ok` or `no_data`. Status string `json:"s"` }
func (CandleRabbit) ToCandleData ¶
func (cr CandleRabbit) ToCandleData() CandleData
type CandleRequest ¶
type CandleRequest struct { Resolution CandleResolution `json:"resolution" validate:"candle_resolution"` From *JSONTime `json:"from" validate:"required,gte"` To *JSONTime `json:"to" validate:"required,gte,ltefield=From"` }
type CandleResolution ¶
type CandleResolution string
const ( Minute CandleResolution = "1" FiveMinutes CandleResolution = "5" FifteenMinutes CandleResolution = "15" Day CandleResolution = "D" Week CandleResolution = "W" Month CandleResolution = "M" )
Click to show internal directories.
Click to hide internal directories.