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

Add support for querying entry expiration #96

Merged
merged 2 commits into from
Sep 14, 2018
Merged

Conversation

raulk
Copy link
Member

@raulk raulk commented Sep 12, 2018

Adds the following:

  • GetExpiration function on TTLDatastore.
  • ReturnExpirations field on query options.
  • Expiration on query result object.

The only implementation of the affected interface is go-ds-badger, and the PR to implement this functionality is here: ipfs/go-ds-badger#32

@ghost ghost assigned raulk Sep 12, 2018
@ghost ghost added the status/in-progress In progress label Sep 12, 2018
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

LGTM but we should get either @bigs or @magik6k to sign off on this as well.

Limit int // maximum number of results
Offset int // skip given number of results
KeysOnly bool // return only keys.
ReturnExpirations bool // return expirations (see TTLDatastore)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe GetExpirations?

Copy link
Member Author

Choose a reason for hiding this comment

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

@magik6k I considered GetExpirations, but discarded it because it implies that the impl may perform an extra lookup to populate the field, when in reality the spirit is to allow returning this value if its available in the iterator.

@raulk
Copy link
Member Author

raulk commented Sep 13, 2018

Thanks all. Holding off on merge until ipfs/go-ds-badger#32 is approved, to avoid breaking interfaces.

@raulk raulk merged commit a350e75 into ipfs:master Sep 14, 2018
@ghost ghost removed the status/in-progress In progress label Sep 14, 2018
@raulk raulk deleted the expiration branch September 14, 2018 11:28
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.

4 participants