Skip to content

Add support for querying entry expiration#96

Merged
raulk merged 2 commits intoipfs:masterfrom
raulk:expiration
Sep 14, 2018
Merged

Add support for querying entry expiration#96
raulk merged 2 commits intoipfs:masterfrom
raulk:expiration

Conversation

@raulk
Copy link
Copy Markdown
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

@raulk raulk requested review from Stebalien and bigs September 12, 2018 19:30
@ghost ghost assigned raulk Sep 12, 2018
@ghost ghost added the status/in-progress In progress label Sep 12, 2018
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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