DeleteKeyValue will delete this KeyValue store (JetStream stream).
(ctx context.Context, bucket string)
| 729 | |
| 730 | // DeleteKeyValue will delete this KeyValue store (JetStream stream). |
| 731 | func (js *jetStream) DeleteKeyValue(ctx context.Context, bucket string) error { |
| 732 | if !bucketValid(bucket) { |
| 733 | return ErrInvalidBucketName |
| 734 | } |
| 735 | stream := fmt.Sprintf(kvBucketNameTmpl, bucket) |
| 736 | if err := js.DeleteStream(ctx, stream); err != nil { |
| 737 | if errors.Is(err, ErrStreamNotFound) { |
| 738 | err = errors.Join(fmt.Errorf("%w: %s", ErrBucketNotFound, bucket), err) |
| 739 | } |
| 740 | return err |
| 741 | } |
| 742 | return nil |
| 743 | } |
| 744 | |
| 745 | // KeyValueStoreNames is used to retrieve a list of key value store names |
| 746 | func (js *jetStream) KeyValueStoreNames(ctx context.Context) KeyValueNamesLister { |
nothing calls this directly
no test coverage detected