Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(a *apd.Decimal) *apd.Decimal
- func Add(a, b *apd.Decimal) *apd.Decimal
- func CeilFloat(val float64, precision uint32) float64
- func Div(a, b *apd.Decimal) *apd.Decimal
- func Eq(a, b *apd.Decimal) bool
- func FindPrecisionFromTickSize(tickSize string) *int
- func FloorFloat(val float64, precision uint32) float64
- func FromFloat64(x float64) *apd.Decimal
- func FromString(x string) *apd.Decimal
- func FromStringErr(x string) (*apd.Decimal, error)
- func FromUint(x uint) *apd.Decimal
- func GenClientOrderID(identifierID string) (string, error)
- func Greater(a, b *apd.Decimal) bool
- func GreaterOrEq(a, b *apd.Decimal) bool
- func Less(a, b *apd.Decimal) bool
- func LessOrEq(a, b *apd.Decimal) bool
- func MinInt(a, b int) int
- func Mod(a, b *apd.Decimal) *apd.Decimal
- func Mul(a, b *apd.Decimal) *apd.Decimal
- func Neg(a *apd.Decimal) *apd.Decimal
- func NewZero() *apd.Decimal
- func Reduce(x *apd.Decimal) *apd.Decimal
- func ReplaceError(new, old error) error
- func Round(a *apd.Decimal) *apd.Decimal
- func RoundFloat(val float64, precision uint32) float64
- func SetFloat64(a float64) *apd.Decimal
- func Sub(a, b *apd.Decimal) *apd.Decimal
- func TimePtr(t time.Time) *time.Time
- func TimeUNIXMillis(t time.Time) int64
- func ToFlatString(x *apd.Decimal) string
- func ToIntegerInFloat64(a *apd.Decimal) (float64, error)
- func WSConnectAndWatch(ctx context.Context, cfg *WSConfig, lg *zap.Logger) (<-chan WSMessage, error)
- func WSWatch(ctx context.Context, c *websocket.Conn, cfg *WSConfig, lg *zap.Logger) (<-chan WSMessage, error)
- type APDJSON
- type CancellableTimer
- type ChangeableMinuteRateLimiter
- type MinuteRateLimiter
- type NullJSONValue
- type RemainingForMinute
- type WSConfig
- type WSMessage
Constants ¶
View Source
const MaxPreciseFloat64Integer int64 = 1 << 53
View Source
const MinPreciseFloat64Integer int64 = -(1 << 53)
Variables ¶
Functions ¶
func FindPrecisionFromTickSize ¶
Ticksize format should be 0.xxx
func FloorFloat ¶
func FromString ¶
func GenClientOrderID ¶
func ReplaceError ¶
func RoundFloat ¶
func TimeUNIXMillis ¶
func ToFlatString ¶
Returns flat, non scientific string representation 1000 will be "1000" not like this "1E3" 0.001 will be as "0.001" not like "1E-3"
func WSConnectAndWatch ¶
Types ¶
type APDJSON ¶
func (*APDJSON) UnmarshalJSON ¶
type CancellableTimer ¶
type CancellableTimer struct { C chan struct{} // contains filtered or unexported fields }
func NewCancellableTimer ¶
func NewCancellableTimer() *CancellableTimer
func (*CancellableTimer) Start ¶
func (t *CancellableTimer) Start(d time.Duration)
func (*CancellableTimer) Stop ¶
func (t *CancellableTimer) Stop()
Stop can be called many times. Works on already stopeed timer.
type ChangeableMinuteRateLimiter ¶
type ChangeableMinuteRateLimiter struct {
// contains filtered or unexported fields
}
func NewChangeableMinuteRateLimiter ¶
func NewChangeableMinuteRateLimiter(maxPerMinute int) *ChangeableMinuteRateLimiter
func (*ChangeableMinuteRateLimiter) SetNextDuration ¶
func (r *ChangeableMinuteRateLimiter) SetNextDuration(d time.Duration)
func (*ChangeableMinuteRateLimiter) SetRemaining ¶
func (r *ChangeableMinuteRateLimiter) SetRemaining(at time.Time, remaining uint)
func (*ChangeableMinuteRateLimiter) Wait ¶
func (r *ChangeableMinuteRateLimiter) Wait()
type MinuteRateLimiter ¶
type MinuteRateLimiter struct {
// contains filtered or unexported fields
}
func NewMinuteRateLimiter ¶
func NewMinuteRateLimiter(maxPerMinute int) *MinuteRateLimiter
func (*MinuteRateLimiter) Wait ¶
func (r *MinuteRateLimiter) Wait()
type NullJSONValue ¶
type NullJSONValue struct{}
NullJSONValue is used as workaround for Golang's case-insensitive JSON
func (*NullJSONValue) MarshalJSON ¶
func (m *NullJSONValue) MarshalJSON() ([]byte, error)
func (*NullJSONValue) UnmarshalJSON ¶
func (m *NullJSONValue) UnmarshalJSON(data []byte) error
type RemainingForMinute ¶
type RemainingForMinute struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.