示例#1
0
func (m *callReq) write(w *typed.WriteBuffer) error {
	w.WriteUint32(uint32(m.TimeToLive.Seconds() * 1000))
	m.Tracing.write(w)
	w.WriteLen8String(m.Service)
	m.Headers.write(w)
	return w.Err()
}
示例#2
0
func writeHeaders(w *typed.WriteBuffer, headers map[string]string) {
	w.WriteSingleByte(byte(len(headers))) // number of headers
	for k, v := range headers {
		w.WriteLen8String(k)
		w.WriteLen8String(v)
	}
}
示例#3
0
func (ch transportHeaders) write(w *typed.WriteBuffer) {
	w.WriteSingleByte(byte(len(ch)))

	for k, v := range ch {
		w.WriteLen8String(k.String())
		w.WriteLen8String(v)
	}
}