types

package
v0.0.0-...-4c7f48a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Number

type Number float64

Number represents a floating point number, and implements json.Unmarshaller and json.Marshaller

func (Number) Decimal

func (f Number) Decimal() decimal.Decimal

Decimal returns a decimal.Decimal

func (Number) Float64

func (f Number) Float64() float64

Float64 returns the underlying float64

func (Number) Int64

func (f Number) Int64() int64

Int64 returns the truncated integer component of the number

func (Number) MarshalJSON

func (f Number) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler by formatting to a json string 1337.37 will marshal to "1337.37" 0 will marshal to an empty string: ""

func (Number) String

func (f Number) String() string

String returns a string representation of the number

func (*Number) UnmarshalJSON

func (f *Number) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type Time

type Time time.Time

Time represents a time.Time object that can be unmarshalled from a float64 or string. MarshalJSON serializes the time to JSON using RFC 3339 format. Note: Not all exchanges may support RFC 3339 for outbound requests, so ensure compatibility with each exchange's time format requirements.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON serializes the time to json.

func (Time) String

func (t Time) String() string

String returns a string representation of the time.

func (Time) Time

func (t Time) Time() time.Time

Time represents a time instance.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes json, and timestamp information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL