-
Notifications
You must be signed in to change notification settings - Fork 40.5k
Change all duration fields in the API to time.Duration #6013
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
Comments
caution when using non-dumb-struct types in the API. For example, they can On Thu, Mar 26, 2015 at 1:55 PM, Brian Grant [email protected]
|
Yeah we'll have to make a wrapper type to make json encode/decode call Duration.String() and ParseDuration(). |
I filed golang/go#10275 on the off chance that we code get this working by default. |
And unfortunately when we do that JSON starts showing the field automatically even with omitempty because the JSON encoder has a structured list of types. So you get a lot of "foo": "", showing up. Definitely hit the limits of the JSON stdlib now. ----- Original Message -----
|
We decided that we would not use duration because the encoding isn't stable. Closing this and we can reopen the discussion on the next time API field. |
We have a number of fields in the API that represent an integer number of seconds, such as TimeoutSeconds. We should push the units into the value instead, by using time.Duration. That would be similar to the approach used for resource quantities.
I don't consider this blocking for v1beta3, but seems like a worthwhile change to make in the future.
cc @lavalamp @smarterclayton
The text was updated successfully, but these errors were encountered: