MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / String

Method String

projects/Go/proto/protoex/Order.go:116–137  ·  view source on GitHub ↗

Convert struct to string

()

Source from the content-addressed store, hash-verified

114
115// Convert struct to string
116func (s *Order) String() string {
117 var sb strings.Builder
118 sb.WriteString("Order(")
119 sb.WriteString("id=")
120 sb.WriteString(strconv.FormatInt(int64(s.Id), 10))
121 sb.WriteString(",symbol=")
122 sb.WriteString("\"" + s.Symbol + "\"")
123 sb.WriteString(",side=")
124 sb.WriteString(s.Side.String())
125 sb.WriteString(",type=")
126 sb.WriteString(s.Type.String())
127 sb.WriteString(",price=")
128 sb.WriteString(strconv.FormatFloat(float64(s.Price), 'g', -1, 64))
129 sb.WriteString(",volume=")
130 sb.WriteString(strconv.FormatFloat(float64(s.Volume), 'g', -1, 64))
131 sb.WriteString(",tp=")
132 sb.WriteString(strconv.FormatFloat(float64(s.Tp), 'g', -1, 64))
133 sb.WriteString(",sl=")
134 sb.WriteString(strconv.FormatFloat(float64(s.Sl), 'g', -1, 64))
135 sb.WriteString(")")
136 return sb.String()
137}
138
139// Convert struct to JSON
140func (s *Order) JSON() ([]byte, error) {

Callers 9

OnReceiveMethod · 0.45
OnReceiveMethod · 0.45
StringMethod · 0.45
SendOrderMessageMethod · 0.45
SendBalanceMessageMethod · 0.45
SendAccountMessageMethod · 0.45
SendOrderMessageMethod · 0.45
SendBalanceMessageMethod · 0.45
SendAccountMessageMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected