Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] Listing KeyValue store and KeyValue store names #1088

Merged
merged 2 commits into from Sep 20, 2022
Merged

Conversation

piotrpio
Copy link
Collaborator

Resolves #1075

@coveralls
Copy link

coveralls commented Sep 19, 2022

Coverage Status

Coverage increased (+0.06%) to 85.832% when pulling fa8e708 on kv-list-buckets into 715a591 on main.

kv.go Outdated Show resolved Hide resolved
func (js *js) KeyValueStoreNames() <-chan string {
ch := make(chan string)
l := &streamLister{js: js}
l.js.opts.streamListSubject = fmt.Sprintf(kvSubjectsTmpl, "*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if this subject will work with the JS Prefix? Or whether it needs something like js.apiSubj() to make it so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the filter subject for STREAM.LIST api and points to $KV.%s.>. AFAIK, CreateKeyValue() creates a stream with interest in this subject (%s is the name), so there is no need for $JS prefix. Or do I misunderstand it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh right, ok then there is no need for the prefix there.

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@piotrpio piotrpio merged commit 8e72eaa into main Sep 20, 2022
@piotrpio piotrpio deleted the kv-list-buckets branch September 20, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KV API: list buckets and bucket names
3 participants