(ctx context.Context, js *jetStream, stream, consumer string)
| 436 | } |
| 437 | |
| 438 | func deleteConsumer(ctx context.Context, js *jetStream, stream, consumer string) error { |
| 439 | ctx, cancel := js.wrapContextWithoutDeadline(ctx) |
| 440 | if cancel != nil { |
| 441 | defer cancel() |
| 442 | } |
| 443 | if err := validateConsumerName(consumer); err != nil { |
| 444 | return err |
| 445 | } |
| 446 | deleteSubject := fmt.Sprintf(apiConsumerDeleteT, stream, consumer) |
| 447 | |
| 448 | var resp consumerDeleteResponse |
| 449 | |
| 450 | if _, err := js.apiRequestJSON(ctx, deleteSubject, &resp); err != nil { |
| 451 | return err |
| 452 | } |
| 453 | if resp.Error != nil { |
| 454 | if resp.Error.ErrorCode == JSErrCodeConsumerNotFound { |
| 455 | return ErrConsumerNotFound |
| 456 | } |
| 457 | return resp.Error |
| 458 | } |
| 459 | return nil |
| 460 | } |
| 461 | |
| 462 | func pauseConsumer(ctx context.Context, js *jetStream, stream, consumer string, pauseUntil *time.Time) (*ConsumerPauseResponse, error) { |
| 463 | ctx, cancel := js.wrapContextWithoutDeadline(ctx) |
no test coverage detected