aboutsummaryrefslogtreecommitdiff
path: root/garage.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-06-24 09:17:09 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-06-24 09:17:09 +0200
commita7edf6d1ba812f11b7711c4bdc6dc6d9af9c7906 (patch)
tree4142845ef1c8d9c7c54ffb3484c6814ed0157ea0 /garage.go
parent9cd06c95eba491bce1a60f7d1b2fef320aec1124 (diff)
downloadguichet-a7edf6d1ba812f11b7711c4bdc6dc6d9af9c7906.tar.gz
guichet-a7edf6d1ba812f11b7711c4bdc6dc6d9af9c7906.zip
bump garage SDK
Diffstat (limited to 'garage.go')
-rw-r--r--garage.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/garage.go b/garage.go
index f9529e9..52a26b0 100644
--- a/garage.go
+++ b/garage.go
@@ -23,8 +23,9 @@ func gadmin() (*garage.APIClient, context.Context) {
func grgCreateKey(name string) (*garage.KeyInfo, error) {
client, ctx := gadmin()
- kr := garage.AddKeyRequest{Name: &name}
- resp, _, err := client.KeyApi.AddKey(ctx).AddKeyRequest(kr).Execute()
+ kr := garage.NewAddKeyRequest()
+ kr.SetName(name)
+ resp, _, err := client.KeyApi.AddKey(ctx).AddKeyRequest(*kr).Execute()
if err != nil {
fmt.Printf("%+v\n", err)
return nil, err
@@ -35,7 +36,7 @@ func grgCreateKey(name string) (*garage.KeyInfo, error) {
func grgGetKey(accessKey string) (*garage.KeyInfo, error) {
client, ctx := gadmin()
- resp, _, err := client.KeyApi.GetKey(ctx, accessKey).Execute()
+ resp, _, err := client.KeyApi.GetKey(ctx).Id(accessKey).ShowSecretKey("true").Execute()
if err != nil {
fmt.Printf("%+v\n", err)
return nil, err
@@ -88,7 +89,7 @@ func allowWebsiteDefault() *garage.UpdateBucketRequestWebsiteAccess {
func grgUpdateBucket(bid string, ur *garage.UpdateBucketRequest) (*garage.BucketInfo, error) {
client, ctx := gadmin()
- binfo, _, err := client.BucketApi.UpdateBucket(ctx, bid).UpdateBucketRequest(*ur).Execute()
+ binfo, _, err := client.BucketApi.UpdateBucket(ctx).Id(bid).UpdateBucketRequest(*ur).Execute()
if err != nil {
fmt.Printf("%+v\n", err)
return nil, err
@@ -145,7 +146,7 @@ func grgDelLocalAlias(bid, key, alias string) (*garage.BucketInfo, error) {
func grgGetBucket(bid string) (*garage.BucketInfo, error) {
client, ctx := gadmin()
- resp, _, err := client.BucketApi.GetBucketInfo(ctx, bid).Execute()
+ resp, _, err := client.BucketApi.GetBucketInfo(ctx).Id(bid).Execute()
if err != nil {
log.Println(err)
return nil, err
@@ -157,7 +158,7 @@ func grgGetBucket(bid string) (*garage.BucketInfo, error) {
func grgDeleteBucket(bid string) error {
client, ctx := gadmin()
- _, err := client.BucketApi.DeleteBucket(ctx, bid).Execute()
+ _, err := client.BucketApi.DeleteBucket(ctx).Id(bid).Execute()
if err != nil {
log.Println(err)
}