(pe packetEncoder)
| 180 | } |
| 181 | |
| 182 | func (t *TopicDetail) encode(pe packetEncoder) error { |
| 183 | pe.putInt32(t.NumPartitions) |
| 184 | pe.putInt16(t.ReplicationFactor) |
| 185 | |
| 186 | if err := pe.putArrayLength(len(t.ReplicaAssignment)); err != nil { |
| 187 | return err |
| 188 | } |
| 189 | for partition, assignment := range t.ReplicaAssignment { |
| 190 | pe.putInt32(partition) |
| 191 | if err := pe.putInt32Array(assignment); err != nil { |
| 192 | return err |
| 193 | } |
| 194 | pe.putEmptyTaggedFieldArray() |
| 195 | } |
| 196 | |
| 197 | if err := pe.putArrayLength(len(t.ConfigEntries)); err != nil { |
| 198 | return err |
| 199 | } |
| 200 | for configKey, configValue := range t.ConfigEntries { |
| 201 | if err := pe.putString(configKey); err != nil { |
| 202 | return err |
| 203 | } |
| 204 | if err := pe.putNullableString(configValue); err != nil { |
| 205 | return err |
| 206 | } |
| 207 | pe.putEmptyTaggedFieldArray() |
| 208 | } |
| 209 | |
| 210 | pe.putEmptyTaggedFieldArray() |
| 211 | return nil |
| 212 | } |
| 213 | |
| 214 | func (t *TopicDetail) decode(pd packetDecoder, version int16) (err error) { |
| 215 | if t.NumPartitions, err = pd.getInt32(); err != nil { |
nothing calls this directly
no test coverage detected