v2.0.0 Beta #1538
Replies: 7 comments 16 replies
-
Hello. I’m a user of cloudflare kv package with go. # 1 In the process of listing and deleting keys in the namespace, I went through the process of checking This is an example of it. (ver 0.9x) for {
resp, err := s.api.ListWorkersKVKeys(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.ListWorkersKVsParams{
NamespaceID: s.namespaceID,
Cursor: cursor,
})
if err != nil {
log.Printf("Error occur in ListWorkersKVKeys: %v", err)
return err
}
keys = make([]string, len(resp.Result))
for _, element := range resp.Result {
name := element.Name
keys = append(keys, name)
}
_, err = s.api.DeleteWorkersKVEntries(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.DeleteWorkersKVEntriesParams{
NamespaceID: s.namespaceID,
Keys: keys,
})
if err != nil {
log.Printf("Error occur in DeleteWorker: %v", err)
return err
}
if len(resp.Cursor) == 0 {
log.Println("No keys left in the namespace")
break
}
cursor = resp.Cursor
} But in v2, I found a # 2 Would you add a flag of If there's something that I'm wrong about, please tell me. :) |
Beta Was this translation helpful? Give feedback.
-
What's the future of flarectl once v2 ships? I was just lamenting that the current flarectl doesn't support the rules engine. A full-featured CLI would take my Cloudflare config experience to Cloud 9. I don't see that Stainless supports generating a CLI, but I see there are other tools that claim to be able to do so. Is Cloudflare planning to offer a CLI that's autogenerated from the OpenAPI Spec -- or will it be left to the community to provide something? |
Beta Was this translation helpful? Give feedback.
-
It would be great to have mocks as a part of the new library. I am incorporating unit tests with my code, and it would be great to be able to just import existing ones. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying out the v2 library and in general I'm happy with a group-up clean-up. Unfortunately I noticed an issue that prevents me from adopting it and I hope we can resolve it. Currently, the |
Beta Was this translation helpful? Give feedback.
-
This has been fixed I have another question: apparently I don't understand how type AccountGetParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
} |
Beta Was this translation helpful? Give feedback.
-
Regarding error handling, the 2.x approach looks much better than 0.x, but I don't understand this principle about avoiding wrapping:
Why should we avoid wrapping in other cases? |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Warning
v2.x
of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types until GA. If this isn't suitable for you project, we recommend
pinning to the
0.x
releases for now.We're working on a new major version of our SDK and are excited to have you test it!
Please use this discussion page as a place to report issues and feedback about the new release.
Install
Code
https://github.com/cloudflare/cloudflare-go/tree/v2
Things we would like feedback on
Migration guide
0.x to 2.x upgrade guide
Beta Was this translation helpful? Give feedback.
All reactions