MCPcopy Create free account
hub / github.com/apache/thrift / WriteMapBegin

Method WriteMapBegin

lib/go/thrift/json_protocol.go:117–139  ·  view source on GitHub ↗
(ctx context.Context, keyType TType, valueType TType, size int)

Source from the content-addressed store, hash-verified

115func (p *TJSONProtocol) WriteFieldStop(ctx context.Context) error { return nil }
116
117func (p *TJSONProtocol) WriteMapBegin(ctx context.Context, keyType TType, valueType TType, size int) error {
118 if e := p.OutputListBegin(); e != nil {
119 return e
120 }
121 s, e1 := p.TypeIdToString(keyType)
122 if e1 != nil {
123 return e1
124 }
125 if e := p.WriteString(ctx, s); e != nil {
126 return e
127 }
128 s, e1 = p.TypeIdToString(valueType)
129 if e1 != nil {
130 return e1
131 }
132 if e := p.WriteString(ctx, s); e != nil {
133 return e
134 }
135 if e := p.WriteI64(ctx, int64(size)); e != nil {
136 return e
137 }
138 return p.OutputObjectBegin()
139}
140
141func (p *TJSONProtocol) WriteMapEnd(ctx context.Context) error {
142 if e := p.OutputObjectEnd(); e != nil {

Callers 1

TestWriteJSONProtocolMapFunction · 0.95

Calls 5

TypeIdToStringMethod · 0.95
WriteStringMethod · 0.95
WriteI64Method · 0.95
OutputListBeginMethod · 0.80
OutputObjectBeginMethod · 0.80

Tested by 1

TestWriteJSONProtocolMapFunction · 0.76