MCPcopy
hub / github.com/segmentio/kafka-go / write

Method write

write.go:126–147  ·  view source on GitHub ↗
(a interface{})

Source from the content-addressed store, hash-verified

124}
125
126func (wb *writeBuffer) write(a interface{}) {
127 switch v := a.(type) {
128 case int8:
129 wb.writeInt8(v)
130 case int16:
131 wb.writeInt16(v)
132 case int32:
133 wb.writeInt32(v)
134 case int64:
135 wb.writeInt64(v)
136 case string:
137 wb.writeString(v)
138 case []byte:
139 wb.writeBytes(v)
140 case bool:
141 wb.writeBool(v)
142 case writable:
143 v.writeTo(wb)
144 default:
145 panic(fmt.Sprintf("unsupported type: %T", a))
146 }
147}
148
149func (wb *writeBuffer) Write(b []byte) (int, error) {
150 return wb.w.Write(b)

Callers 2

TestMessageCRC32Function · 0.95
TestProtocolFunction · 0.95

Calls 8

writeInt8Method · 0.95
writeInt16Method · 0.95
writeInt32Method · 0.95
writeInt64Method · 0.95
writeStringMethod · 0.95
writeBytesMethod · 0.95
writeBoolMethod · 0.95
writeToMethod · 0.65

Tested by 2

TestMessageCRC32Function · 0.76
TestProtocolFunction · 0.76