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

Unexpected type for time in milliseconds #113

Open
nerg4l opened this issue Dec 23, 2021 · 0 comments
Open

Unexpected type for time in milliseconds #113

nerg4l opened this issue Dec 23, 2021 · 0 comments
Assignees

Comments

@nerg4l
Copy link

nerg4l commented Dec 23, 2021

I started to use this library to create an uptime service. While using this lib I noticed it is quite annoying to pass time and duration values in some cases because the accepted value most of the cases is an int or uint instead of time.Time or time.Duration.

  • RetentionMSecs field of CreateOptions is time.Duration.
  • TimeBucket field of RangeOptions and MultiRangeOptions is int.
  • fromTimestamp and toTimestamp parameter of RangeWithOptions is int64.
  • bucketSizeMSec parameter of CreateRule is uint.

Furthermore, TimeRangeMinimum and TimeRangeMaximum are ints there for the following code fails to compile:

start := rts.TimeRangeMinimum
end := rts.TimeRangeMaximum
points, err := c.RangeWithOptions("key", start, end, rts.DefaultRangeOptions)

Is it something which could be fixed in a potential v2 in the future?

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

No branches or pull requests

3 participants