newTopic makes a pubsub.Topic from a driver.Topic. opts may be nil to accept defaults.
(d driver.Topic, opts *batcher.Options)
| 345 | // |
| 346 | // opts may be nil to accept defaults. |
| 347 | func newTopic(d driver.Topic, opts *batcher.Options) *Topic { |
| 348 | ctx, cancel := context.WithCancel(context.Background()) |
| 349 | t := &Topic{ |
| 350 | driver: d, |
| 351 | tracer: gcdkotel.NewTracer(pkgName, gcdkotel.ProviderName(d)), |
| 352 | cancel: cancel, |
| 353 | } |
| 354 | t.batcher = newSendBatcher(ctx, t, d, opts) |
| 355 | return t |
| 356 | } |
| 357 | |
| 358 | const pkgName = "gocloud.dev/pubsub" |
| 359 |
nothing calls this directly
no test coverage detected