Documentation ¶
Index ¶
- Variables
- func BeginningOfTheDay(t time.Time) time.Time
- func MustParseUnixTimestamp(a string) time.Time
- func Over24Hours(since time.Time) bool
- func ParseInterval(input Interval) int
- func ParseTimeWithFormats(strTime string, formats []string) (time.Time, error)
- type Interval
- type IntervalSlice
- type IntervalWindow
- type IntervalWindowBandWidth
- type LooseFormatTime
- type MillisecondTimestamp
- type NanosecondTimestamp
- type Time
- func (t Time) After(time2 time.Time) bool
- func (t Time) Before(time2 time.Time) bool
- func (t Time) Equal(time2 time.Time) bool
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) Scan(src interface{}) error
- func (t Time) String() string
- func (t Time) Time() time.Time
- func (t Time) Unix() int64
- func (t Time) UnixMilli() int64
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t Time) Value() (driver.Value, error)
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
View Source
var Interval12h = Interval("12h")
View Source
var Interval15m = Interval("15m")
View Source
var Interval1d = Interval("1d")
View Source
var Interval1h = Interval("1h")
View Source
var Interval1m = Interval("1m")
View Source
var Interval1mo = Interval("1mo")
View Source
var Interval1ms = Interval("1ms")
View Source
var Interval1s = Interval("1s")
View Source
var Interval1w = Interval("1w")
View Source
var Interval2h = Interval("2h")
View Source
var Interval2w = Interval("2w")
View Source
var Interval30m = Interval("30m")
View Source
var Interval3d = Interval("3d")
View Source
var Interval3m = Interval("3m")
View Source
var Interval4h = Interval("4h")
View Source
var Interval5m = Interval("5m")
View Source
var Interval6h = Interval("6h")
View Source
var SupportedIntervals = map[Interval]int{ Interval1s: 1, Interval1m: 1 * 60, Interval3m: 3 * 60, Interval5m: 5 * 60, Interval15m: 15 * 60, Interval30m: 30 * 60, Interval1h: 60 * 60, Interval2h: 60 * 60 * 2, Interval4h: 60 * 60 * 4, Interval6h: 60 * 60 * 6, Interval12h: 60 * 60 * 12, Interval1d: 60 * 60 * 24, Interval3d: 60 * 60 * 24 * 3, Interval1w: 60 * 60 * 24 * 7, Interval2w: 60 * 60 * 24 * 14, Interval1mo: 60 * 60 * 24 * 30, }
Functions ¶
func MustParseUnixTimestamp ¶
func Over24Hours ¶
func ParseInterval ¶
Types ¶
type Interval ¶
type Interval string
func (Interval) Milliseconds ¶
Milliseconds is specially handled, for better precision for ms level interval, calling Seconds and Minutes directly might trigger panic error
func (*Interval) UnmarshalJSON ¶
type IntervalSlice ¶
type IntervalSlice []Interval
func (IntervalSlice) StringSlice ¶
func (s IntervalSlice) StringSlice() (slice []string)
type IntervalWindow ¶
type IntervalWindow struct { // The interval of kline Interval Interval `json:"interval"` // The windows size of the indicator (for example, EWMA and SMA) Window int `json:"window"` // RightWindow is used by the pivot indicator RightWindow int `json:"rightWindow"` }
IntervalWindow is used by the indicators
func (IntervalWindow) String ¶
func (iw IntervalWindow) String() string
type IntervalWindowBandWidth ¶
type IntervalWindowBandWidth struct { IntervalWindow BandWidth float64 `json:"bandWidth"` }
type LooseFormatTime ¶
LooseFormatTime parses date time string with a wide range of formats.
func ParseLooseFormatTime ¶
func ParseLooseFormatTime(s string) (LooseFormatTime, error)
func (LooseFormatTime) MarshalJSON ¶
func (t LooseFormatTime) MarshalJSON() ([]byte, error)
func (LooseFormatTime) Time ¶
func (t LooseFormatTime) Time() time.Time
func (*LooseFormatTime) UnmarshalJSON ¶
func (t *LooseFormatTime) UnmarshalJSON(data []byte) error
func (*LooseFormatTime) UnmarshalYAML ¶
func (t *LooseFormatTime) UnmarshalYAML(unmarshal func(interface{}) error) error
type MillisecondTimestamp ¶
func MustParseMillisecondTimestamp ¶
func MustParseMillisecondTimestamp(a string) MillisecondTimestamp
func NewMillisecondTimestampFromInt ¶
func NewMillisecondTimestampFromInt(i int64) MillisecondTimestamp
func (MillisecondTimestamp) String ¶
func (t MillisecondTimestamp) String() string
func (MillisecondTimestamp) Time ¶
func (t MillisecondTimestamp) Time() time.Time
func (*MillisecondTimestamp) UnmarshalJSON ¶
func (t *MillisecondTimestamp) UnmarshalJSON(data []byte) error
type NanosecondTimestamp ¶
func (NanosecondTimestamp) Time ¶
func (t NanosecondTimestamp) Time() time.Time
func (*NanosecondTimestamp) UnmarshalJSON ¶
func (t *NanosecondTimestamp) UnmarshalJSON(data []byte) error
type Time ¶
Time type implements the driver value for sqlite
func NewTimeFromUnix ¶
func (Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
type Timestamp ¶
Timestamp is used for parsing unix timestamp (seconds)
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.