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
I am writing a utility to download a script, modify it, and upload it again to a new name.
It would be useful if the input and output formats for the Bindings structure matched up. I am reading the code to see if there's a simple enough way to transform the structures, but I figured I'd file this before I got too deep.
Use cases
This is similar to the Workers Environments use case, so future work on that product feature might subsume this eventually, but download-modify-upload is still a valuable capability.
cannot use bindings.BindingList (variable of type []cloudflare.WorkerBindingListItem)
as type map[string]cloudflare.WorkerBinding in struct literal
References
Aha, this might do it. I feel like this comment is a clue that maybe the data structure mismatch ought to have been resolved in the code review process. How would you feel if I put up a PR to make UploadWorkerWithBindings accept an array instead of a map? Was the idea to use a map to avoid the case of two bindings with the same name? In that case, should the ListWorkerBindings return an array? Maybe a convenience method to munge between them?
Current cloudflare-go version
0.45
Description
I am writing a utility to download a script, modify it, and upload it again to a new name.
It would be useful if the input and output formats for the Bindings structure matched up. I am reading the code to see if there's a simple enough way to transform the structures, but I figured I'd file this before I got too deep.
Use cases
This is similar to the Workers Environments use case, so future work on that product feature might subsume this eventually, but download-modify-upload is still a valuable capability.
Potential cloudflare-go usage
Unfortunately, this won't compile:
References
Aha, this might do it. I feel like this comment is a clue that maybe the data structure mismatch ought to have been resolved in the code review process. How would you feel if I put up a PR to make UploadWorkerWithBindings accept an array instead of a map? Was the idea to use a map to avoid the case of two bindings with the same name? In that case, should the ListWorkerBindings return an array? Maybe a convenience method to munge between them?
cloudflare-go/workers_test.go
Lines 233 to 240 in 9a9f293
The text was updated successfully, but these errors were encountered: