Comments (4)
Q: What benefit does passing Zone
as the function argument give (today, and in the future) if we require the user to do the name => ID lookup prior?
I 100% agree that rationalizing the function signatures is useful, and would be OK with a functions accepting a zoneID string
instead of a zoneName string
.
We can provide a helper function around the APIโZoneByName(zoneName string) (string, error)
via GET /zone?name=$name
โthat returns the zoneID for the package user to cache locally and then pass to functions as needed. The package user can async that as needed (via a waitgroup or channels) if they have a bunch of zones to lookup.
from cloudflare-go.
Initially I wanted as little friction as possible for users of the library/API so thought it made more sense, in most cases, to pass in the zone name and have the function do the zone ID lookup for you. There were one or two cases where it seemed to make more sense to use the object instead.
I do agree that this needs cleaning up and made more consistent.
from cloudflare-go.
Accepting Zone
instead of a zone ID would mean we could check if the plan of a zone allow an action to be made, without firing a request to the API. That's the only thing I could think of from the top of my head, and may not be enough reason to require users to use Zone
everywhere.
I think accepting the zone ID as a string would be the best option then.
from cloudflare-go.
This was done in #22.
from cloudflare-go.
Related Issues (20)
- Version tag not recognized by go (`V0.77.0` instead of `v0.77.0`) HOT 3
- Add `maxDurationSeconds` and `Expiry` for TUS Uploads
- Zerotrust / Access User endpoints. HOT 2
- All API documentation links are incorrect HOT 1
- What does "foo" mean in `CHANGELOG.md`? HOT 3
- ListLoadBalancerPools doesn't return Pagination details to impossible to tell if you have more results to go through HOT 1
- Support for List Images v2 and continuation tokens
- I've asked repeatedly HOT 1
- Support for Send Email Worker Bindings
- Delete by filters HOT 1
- Zone command group doesn't work in flarectl amd64 build of v0.83.0 github release HOT 4
- Stream file in UploadImage to reduce memory usage
- No pagination options for ListOriginCertificates
- UpdateAccessUsersSeats does not work because API expects an Array, and method sends a single object HOT 1
- ListAccessUsers returns wrong results for AccessSeat and GatewaySeat when it paginates due to loop variable HOT 1
- Add missing draft property to Image struct
- Support for Build Cache of Pages Project
- Add support for Hyperdrive
- Add Support for Images Variants HOT 1
- Streaming Worker Content
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudflare-go.