- Notifications
You must be signed in to change notification settings - Fork928
chore: refactor time.Duration -> int64 milliseconds for FE consumption#1944
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Emyrk commentedJun 1, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Do you want to make it an actual type and write a json marshal? typeMillisecondDuration time.Duration This means the sdk and cli would have an actual duration type. |
Maybe later; doing it with a type alias means you lose all the existing methods on the type and struct-embedding can get weird. |
A lot of the stories say "228 years after start" now, maybe they need to be updated? |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I think I've repaired the temporal anomaly now. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM!
transition: "stop", | ||
}, | ||
autostart_schedule: undefined, | ||
ttl_ms: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm unfamiliar with stories, but since we're usingomitempty
, should we perhaps not define these here? There's a slight change in semantic meaning betweenx: undefined
and omitting it entirely. In the former case, thekey is defined on the object and does not mimic API behavior 1:1.
717f451
tob9b3edf
Compare#1944)* Changes all public-facing codersdk types to use a plain int64 (milliseconds) instead of time.Duration.* Makes autostart_schedule a *string as it may not be present.* Adds a utils/ptr package with some useful methods.
Uh oh!
There was an error while loading.Please reload this page.
This PR changes all public-facing codersdk types to use a plain
int64
(milliseconds) instead oftime.Duration
(nanoseconds) as this is the conventional type in the FE world.Also makes
autostart_schedule
a*string
as it may not be present.Also also adds a
utils/ptr
package with some useful methods.