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

Method toCreateTopicsRequestV0Topic

createtopics.go:207–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205}
206
207func (t TopicConfig) toCreateTopicsRequestV0Topic() createTopicsRequestV0Topic {
208 requestV0ReplicaAssignments := make([]createTopicsRequestV0ReplicaAssignment, 0, len(t.ReplicaAssignments))
209 for _, a := range t.ReplicaAssignments {
210 requestV0ReplicaAssignments = append(
211 requestV0ReplicaAssignments,
212 a.toCreateTopicsRequestV0ReplicaAssignment())
213 }
214 requestV0ConfigEntries := make([]createTopicsRequestV0ConfigEntry, 0, len(t.ConfigEntries))
215 for _, c := range t.ConfigEntries {
216 requestV0ConfigEntries = append(
217 requestV0ConfigEntries,
218 c.toCreateTopicsRequestV0ConfigEntry())
219 }
220
221 return createTopicsRequestV0Topic{
222 Topic: t.Topic,
223 NumPartitions: int32(t.NumPartitions),
224 ReplicationFactor: int16(t.ReplicationFactor),
225 ReplicaAssignments: requestV0ReplicaAssignments,
226 ConfigEntries: requestV0ConfigEntries,
227 }
228}
229
230type createTopicsRequestV0Topic struct {
231 // Topic name

Callers 1

CreateTopicsMethod · 0.80

Tested by

no test coverage detected