(ctx context.Context, js *jetStream, stream, name string)
| 388 | } |
| 389 | |
| 390 | func getPushConsumer(ctx context.Context, js *jetStream, stream, name string) (PushConsumer, error) { |
| 391 | info, err := fetchConsumerInfo(ctx, js, stream, name) |
| 392 | if err != nil { |
| 393 | return nil, err |
| 394 | } |
| 395 | |
| 396 | if info.Config.DeliverSubject == "" { |
| 397 | return nil, ErrNotPushConsumer |
| 398 | } |
| 399 | |
| 400 | cons := &pushConsumer{ |
| 401 | js: js, |
| 402 | stream: stream, |
| 403 | name: name, |
| 404 | info: info, |
| 405 | } |
| 406 | |
| 407 | return cons, nil |
| 408 | } |
| 409 | |
| 410 | func fetchConsumerInfo(ctx context.Context, js *jetStream, stream, name string) (*ConsumerInfo, error) { |
| 411 | ctx, cancel := js.wrapContextWithoutDeadline(ctx) |
no test coverage detected