You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Go SDK uses the ByteCount type to represent the number of bytes for instance memory, disks, and other Oxide resources. Instead of using values with units (e.g., 16GiB), users must convert these values to bytes (e.g., 17179869184). This can lead to issues if users leave off numbers or typo numbers. Some users opt to use a helper like the following to calculate the correct number of bytes.
> python3 -c 'print(16 * 1024**3)'
17179869184
This Go SDK should be updated to allow users to specify a value with a unit (e.g., 16GiB).
Implementation details
The implementation can take inspiration from the following.
Overview
The Go SDK uses the
ByteCount
type to represent the number of bytes for instance memory, disks, and other Oxide resources. Instead of using values with units (e.g.,16GiB
), users must convert these values to bytes (e.g.,17179869184
). This can lead to issues if users leave off numbers or typo numbers. Some users opt to use a helper like the following to calculate the correct number of bytes.This Go SDK should be updated to allow users to specify a value with a unit (e.g.,
16GiB
).Implementation details
The implementation can take inspiration from the following.
Here are function signatures that an implementation can use.
Given those function signatures, here's how a user can use them in code.
Anything else you would like to add?
No response
The text was updated successfully, but these errors were encountered: