(ctx context.Context, js *jetStream, stream, name string)
| 366 | } |
| 367 | |
| 368 | func getConsumer(ctx context.Context, js *jetStream, stream, name string) (Consumer, error) { |
| 369 | info, err := fetchConsumerInfo(ctx, js, stream, name) |
| 370 | if err != nil { |
| 371 | return nil, err |
| 372 | } |
| 373 | |
| 374 | if info.Config.DeliverSubject != "" { |
| 375 | return nil, ErrNotPullConsumer |
| 376 | } |
| 377 | |
| 378 | cons := &pullConsumer{ |
| 379 | js: js, |
| 380 | stream: stream, |
| 381 | name: name, |
| 382 | durable: info.Config.Durable != "", |
| 383 | info: info, |
| 384 | subs: syncx.Map[string, *pullSubscription]{}, |
| 385 | } |
| 386 | |
| 387 | return cons, nil |
| 388 | } |
| 389 | |
| 390 | func getPushConsumer(ctx context.Context, js *jetStream, stream, name string) (PushConsumer, error) { |
| 391 | info, err := fetchConsumerInfo(ctx, js, stream, name) |
no test coverage detected